Okay, this is just silly. I have a menu and when a user select a certain item, I disable the menu by using:
EnableMenuItem(hHandle, Position, MF_BYCOMMAND|MF_GRAYED);
Well, it doesen't update my menu...so my menu still appears that it's not grayed...but when you run your mouse over it and try to select one of the Menu options, it turns gray. I've tried UpdateWindow(), RedrawWindow(), manually sending a WM_PAINT and a WM_ERASEBKGND message. The only thing that I have been able to get to work is to use ShowWindow(Handle, SW_HIDE), then use a ShowWindow(Handle, SW_SHOW). That's the ONLY way I can get it to update and redraw the menu..but I don't like it because 1) It's not right and 2) It makes it flicker and look unprofessional. The other Items that I disable at the same time (2 listboxes) become disabled just fine (course I'm using EnableWindow() to disable these controls). I just need some info on how to get this to work properly...it's driving me nuts that I have to go around it this way to get it to work. Thanks in advance.
Niky Williams
Lead Engineer
NTS Marketing, Inc
EnableMenuItem(hHandle, Position, MF_BYCOMMAND|MF_GRAYED);
Well, it doesen't update my menu...so my menu still appears that it's not grayed...but when you run your mouse over it and try to select one of the Menu options, it turns gray. I've tried UpdateWindow(), RedrawWindow(), manually sending a WM_PAINT and a WM_ERASEBKGND message. The only thing that I have been able to get to work is to use ShowWindow(Handle, SW_HIDE), then use a ShowWindow(Handle, SW_SHOW). That's the ONLY way I can get it to update and redraw the menu..but I don't like it because 1) It's not right and 2) It makes it flicker and look unprofessional. The other Items that I disable at the same time (2 listboxes) become disabled just fine (course I'm using EnableWindow() to disable these controls). I just need some info on how to get this to work properly...it's driving me nuts that I have to go around it this way to get it to work. Thanks in advance.
Niky Williams
Lead Engineer
NTS Marketing, Inc