Click here to Skip to main content
15,883,558 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Initially visible dialog box Pin
Ed K1-Mar-05 10:58
Ed K1-Mar-05 10:58 
GeneralUDP transfer Pin
Raghav SR28-Feb-05 19:21
Raghav SR28-Feb-05 19:21 
GeneralRe: UDP transfer Pin
Alexander M.,1-Mar-05 5:14
Alexander M.,1-Mar-05 5:14 
GeneralMedia Gateway's in VoIP Pin
Raghav SR28-Feb-05 19:18
Raghav SR28-Feb-05 19:18 
Generalon using SSL components Pin
ppp00128-Feb-05 15:58
ppp00128-Feb-05 15:58 
GeneralRe: on using SSL components Pin
valikac28-Feb-05 18:52
valikac28-Feb-05 18:52 
GeneralRe: on using SSL components Pin
Ed K2-Mar-05 4:53
Ed K2-Mar-05 4:53 
GeneralSkinning menus and undoc'd menu msgs Pin
Ron Waller28-Feb-05 11:58
Ron Waller28-Feb-05 11:58 
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
GeneralUnix file locking Pin
Madmaximus28-Feb-05 11:29
Madmaximus28-Feb-05 11:29 
GeneralWin98 system sometimes hangs on ExitWindowsEx() Pin
Still learning how to code28-Feb-05 11:08
Still learning how to code28-Feb-05 11:08 
GeneralRe: Win98 system sometimes hangs on ExitWindowsEx() Pin
PJ Arends28-Feb-05 11:20
professionalPJ Arends28-Feb-05 11:20 
GeneralRe: Win98 system sometimes hangs on ExitWindowsEx() Pin
Still learning how to code28-Feb-05 21:00
Still learning how to code28-Feb-05 21:00 
GeneralRe: Win98 system sometimes hangs on ExitWindowsEx() Pin
Still learning how to code1-Mar-05 10:00
Still learning how to code1-Mar-05 10:00 
GeneralRe: Win98 system sometimes hangs on ExitWindowsEx() Pin
PJ Arends1-Mar-05 19:26
professionalPJ Arends1-Mar-05 19:26 
GeneralDebugging Header includes Pin
hyling28-Feb-05 10:38
hyling28-Feb-05 10:38 
GeneralRe: Debugging Header includes Pin
PJ Arends28-Feb-05 10:53
professionalPJ Arends28-Feb-05 10:53 
GeneralRe: Debugging Header includes Pin
vladfein28-Feb-05 11:53
vladfein28-Feb-05 11:53 
GeneralRe: Debugging Header includes Pin
hyling1-Mar-05 4:13
hyling1-Mar-05 4:13 
GeneralBYTE array question Pin
Tom Wright28-Feb-05 10:33
Tom Wright28-Feb-05 10:33 
GeneralRe: BYTE array question Pin
Ryan Binns28-Feb-05 17:17
Ryan Binns28-Feb-05 17:17 
GeneralRe: BYTE array question Pin
Tom Wright1-Mar-05 3:31
Tom Wright1-Mar-05 3:31 
GeneralRe: BYTE array question Pin
zhang80060528-Feb-05 19:56
zhang80060528-Feb-05 19:56 
GeneralAPI & Resizing the SysTray window Pin
Axonn Echysttas28-Feb-05 9:52
Axonn Echysttas28-Feb-05 9:52 
GeneralRe: API & Resizing the SysTray window Pin
Ryan Binns28-Feb-05 17:19
Ryan Binns28-Feb-05 17:19 
GeneralRe: API & Resizing the SysTray window Pin
Axonn Echysttas28-Feb-05 20:54
Axonn Echysttas28-Feb-05 20:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.