5

I'm writing a hook dll, which handles window drawing messages.
I found for Vista and above, some unknown message id are received by the hook dll, specifically 0x90 ~ 0x95.
I did some googling and found an msdn link and this, which told me what message they're:

#define WM_UAHDESTROYWINDOW 0x0090
#define WM_UAHDRAWMENU 0x0091
#define WM_UAHDRAWMENUITEM 0x0092
#define WM_UAHINITMENU 0x0093
#define WM_UAHMEASUREMENUITEM 0x0094
#define WM_UAHNCPAINTMENUPOPUP 0x0095

But I can't find definition of macro WM_UAHDRAWMENUITEM in any header files, the compiler complains about "undefined symbols". I did a global search on "WM_UAHDRAWMENUITEM" but found nothing.

At present I'm using 0x92 to handle this message.
My question is: how to nicely replace hard-coded 0x92 with a Windows-defined macro?

Guo
  • 305
  • 4
  • 13
  • 3
    Usually, if you can't find documentation for Windows messages then they are internal Windows messages not intended for outside use. ie. use at your own risk. – user1793036 May 20 '14 at 05:18
  • FYI I've documented what these messages do and the structures associated with them here https://github.com/adzm/win32-custom-menubar-aero-theme after some trial and error. They are used to draw the menubar when using themes. – adzm Feb 04 '21 at 21:38

1 Answers1

5

how to nicely replace hard-coded 0x92 with a Windows-defined macro?

Obviously, your installed version of the Win32 SDK does not have the macros, so you can't use them. But you have the #define values, so just copy/paste them directly into your own code. If you want, you can wrap them in an #ifdef so that if you ever upgrade to an SDK version that has them natively, the native macros will be used, otherwise the compiler will keep using your manual ones.

#ifndef WM_UAHDRAWMENUITEM
#define WM_UAHDRAWMENUITEM 0x0092
#endif
Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770