Enabling Menu Items
-
How to enable a menu item dynamically. I have tried EnableMenuItem but with no success.
-
How to enable a menu item dynamically. I have tried EnableMenuItem but with no success.
Use a flag, when you press a button on a dialog or something, set your flag to
TRUE
and inWM_INITMENU
you check whether your flag is TRUE or FALSE and then useEnableMenuItem()
to disable/enable/etc your item. Is everything clear? Rickard Andersson8 Here is my card, contact me later! UIN: 50302279 E-Mail: nikado@pc.nu Interests: C++, ADO, SQL, Winsock, 0s and 1s -
How to enable a menu item dynamically. I have tried EnableMenuItem but with no success.
You could use the ON_UPDATE_COMMAND_UI messages for your menu IDs if you're using MFC.
-
How to enable a menu item dynamically. I have tried EnableMenuItem but with no success.
An application must use the MF_BYPOSITION flag to specify the correct menu handle. If the menu handle to the menu bar is specified, the top-level menu item (an item in the menu bar) is affected. To set the state of an item in a drop-down menu or submenu by position, an application must specify the handle to the drop-down menu or submenu. When an application specifies the MF_BYCOMMAND flag, Windows checks all items that open submenus in the menu identified by the specified menu handle. Therefore, unless duplicate menu items are present, specifying the menu handle to the menu bar is sufficient. // Afterall I realized that even my comment lines have bugs
-
An application must use the MF_BYPOSITION flag to specify the correct menu handle. If the menu handle to the menu bar is specified, the top-level menu item (an item in the menu bar) is affected. To set the state of an item in a drop-down menu or submenu by position, an application must specify the handle to the drop-down menu or submenu. When an application specifies the MF_BYCOMMAND flag, Windows checks all items that open submenus in the menu identified by the specified menu handle. Therefore, unless duplicate menu items are present, specifying the menu handle to the menu bar is sufficient. // Afterall I realized that even my comment lines have bugs
-
Sorry but I forgot to mention that I got that from the API reference so you can refer to that for more information. I have used this function before, and I never had a problem with it. // Afterall I realized that even my comment lines have bugs
-
Use a flag, when you press a button on a dialog or something, set your flag to
TRUE
and inWM_INITMENU
you check whether your flag is TRUE or FALSE and then useEnableMenuItem()
to disable/enable/etc your item. Is everything clear? Rickard Andersson8 Here is my card, contact me later! UIN: 50302279 E-Mail: nikado@pc.nu Interests: C++, ADO, SQL, Winsock, 0s and 1sThanks for your help. I used EnableMenuItem(0with an if statement and it worked.
-
You could use the ON_UPDATE_COMMAND_UI messages for your menu IDs if you're using MFC.
Thanks for the help!!