开发者

How do i get menu events from a menu item in the system menu of a console window?

开发者 https://www.devze.com 2022-12-21 23:22 出处:网络
I have added a menu item to the SystemMenu of the console window of my application which i created using the AllocConsole() function. but I could not figure out how to pro开发者_StackOverflowcess the

I have added a menu item to the SystemMenu of the console window of my application which i created using the AllocConsole() function. but I could not figure out how to pro开发者_StackOverflowcess the events for the menu items I've added.

How can i process those menu events?

Thank you


Did you try overriding window proc of the console window? ie once you have obtained the window handle with GetConsoleWindow and then hooked its window proc with SetWindowLongPtr, you have to listen the WM_SYSCOMMAND message. See this article on how to process menu items from system menu.

0

精彩评论

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

关注公众号