开发者

c++ win32 prevent context menu from closing

开发者 https://www.devze.com 2023-04-08 13:24 出处:网络
I would like to prevent the context menu from being closed in my win32 c++ application. I want to prevent cl开发者_如何转开发osing the submenu when user clicks on a submenu item. Which message do i ha

I would like to prevent the context menu from being closed in my win32 c++ application. I want to prevent cl开发者_如何转开发osing the submenu when user clicks on a submenu item. Which message do i have to implement/override?


Haven't done win32 dev in a while, however just random thoughts that come to my mind - maybe will be helpful:

1) maybe you could try to show the context menu again right after the item was clicked

2) or do it the complex way - find, then subclass the context menu window, then intercept WM_CLOSE/WM_DESTROY messages

Overall this seems to be a weird thing to want to implement. Maybe the menu is not the right UI element if you want to keep it on the screen after the selection was made. Maybe you need a modeless dialog instead?


Please see the following article.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号