I am using the following line of code to enable/disable menu items:
To Disable:
EnableMenuItem (HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUEDIT, %MF_BYCOMMAND Or %MF_DISABLED Or %MF_GRAYED)
To Enable:
EnableMenuItem (HWND_FRMMAIN_TOPMENU, IDC_FRMMAIN_MNUEDIT, %MF_BYCOMMAND Or %MF_ENABLED)
Disabling seems to work just fine. But, after I enable the menu it still stays "grayed" until I click on the item with my mouse pointer then it starts working. Is there some sort of refresh or repaint function that I need to call?
nb
Hi Noble,
Immediately after enabling or disabling, execute the following code:
DrawMenuBar HWND_FRMMAIN
Yup. That did the trick. Thanks.