Enable/disable popup menu items
-
Hi :) I have a popup-menu associated with a window, and I want to specify for each menu entry if it is enabled/disabled. So I'm wondering if my window sends some messages (similar to WM_LBUTTONDOWN for example) just before displaying a menu item? I would like to be able to intercept that message and actualize the enabled/disabled state of that item. I read something about ON_UPDATE_COMMAND_UI but my window is created with CreateWindowEx and I can't do anything with classwizard. How can I handle this task easily :confused: Thanks :)
-
Hi :) I have a popup-menu associated with a window, and I want to specify for each menu entry if it is enabled/disabled. So I'm wondering if my window sends some messages (similar to WM_LBUTTONDOWN for example) just before displaying a menu item? I would like to be able to intercept that message and actualize the enabled/disabled state of that item. I read something about ON_UPDATE_COMMAND_UI but my window is created with CreateWindowEx and I can't do anything with classwizard. How can I handle this task easily :confused: Thanks :)
Handle WM_INITMENU. See MSDN to read about WM_INITMENU ------------------------------ ©0d3 ©®4©k3® - That's me! :) ------------------------------
-
Hi :) I have a popup-menu associated with a window, and I want to specify for each menu entry if it is enabled/disabled. So I'm wondering if my window sends some messages (similar to WM_LBUTTONDOWN for example) just before displaying a menu item? I would like to be able to intercept that message and actualize the enabled/disabled state of that item. I read something about ON_UPDATE_COMMAND_UI but my window is created with CreateWindowEx and I can't do anything with classwizard. How can I handle this task easily :confused: Thanks :)
I dynamically construct the popup menu when I detect a right mouse button click. This way, you can set the disabled state of individual menu items. /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com
-
I dynamically construct the popup menu when I detect a right mouse button click. This way, you can set the disabled state of individual menu items. /ravi "There is always one more bug..." ravib@ravib.com http://www.ravib.com