Hi,
Can anybody tell me how to disable a menu item in Win32 SDK environment.
I am working on "Windows Mobile 5.0 Smartphone".
Regards
Sudha
Printable View
Hi,
Can anybody tell me how to disable a menu item in Win32 SDK environment.
I am working on "Windows Mobile 5.0 Smartphone".
Regards
Sudha
Well, how are you displaying your menus?
The usual technique is to eneble/disable menu items directly before displaying them.
Code:HMENU hResMenu = LoadMenu(g_hinst, MAKEINTRESOURCE(nMenuId));//g_hinst->Handle to the module containing the menu resource to be loaded.
HMENU hMenu = GetSubMenu(hResMenu,0);
EnableMenuItem(hMenu, ID_COMMAND_START, MF_BYCOMMAND | MF_DISABLED);
Use MF_GRAYED rather than MF_DISABLED. And get some reading on those flags in MSDN.