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

931 views Asked by At

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 process the events for the menu items I've added.

How can i process those menu events?

Thank you

1

There are 1 answers

2
Ismael On

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.