Skinning menus and undoc'd menu msgs
-
I was wondering if any has info on the undocumented menu control messages, similar to the button messages: BM_CLICK, etc. I found a really simple way to subclass the menu by changing its windows-class wnd proc. First create an invisible menu window with the class name of "#32768" called from the CMainFrame's OnCreate, using it as a parent: hwnd = CreateWindow( "#32768", "", WS_CHILD, 0,0,10,10, pParent->m_hWnd, (HMENU) 0, AfxGetInstanceHandle(), &cs ); Then replace the window-class wnd proc with your own: s_OldWindowProc = (WNDPROC) SetClassLong( hwnd, GCL_WNDPROC, (DWORD) WindowProc ); Then destroy the window because you don't need it anymore - all menus in your app have the same class wnd proc. In your "WindowProc" you send all the messages to the orginal class proc using CallWindowProc(). Here are the messages and what they seem to do: 0x000001E5: -Draw mouseover item and send statusbar msg. 0x000001EF: -Send out the command msg 0x000001E4: -End of popup menu 0x000001ED: -Process lbuttondown, draw pressed item, send statusbar msg 0x000001EB: -Handles when to send the command and terminate the popup Now I think I have enough to override all the drawing so I can replace it with my own, while maintaining full menu functionality, even though I have to use LockWindowsUpdate() to prevent drawing on 0x01E5 and 0x01ED, while calling the orginal proc. But it would be great to get the message names and the info they have in the Params, which would make skinning the menus a lot easier. Any help or info on where I can this information would be greatly appreciated. BTW, thanks to .dan.g. and his orignal article on the subject for a lot of the information: http://www.codeproject.com/menu/skinmenu.asp