Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Window update problems....help

Status
Not open for further replies.

Valius

Programmer
Oct 20, 2000
174
US
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
 
Nevermind, I found it. Had to use DrawMenuBar() to redraw the menu. Can't believe I missed that.

Niky Williams
Lead Engineer
NTS Marketing, Inc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top