2

The windowsx.h header has a feature called "message crackers", which lets you use HANDLE_MSG and other macros to automatically decode WPARAM and LPARAM, as received by your window procedure, into a specific message's parameters. As of the Windows 10 SDK, these are still around and not marked deprecated within the header itself, and they still work fine. However, MSDN's latest documentation for windowsx.h doesn't even mention the existence of them. The only official documentation I can find for them is WINDOWSX.TXT from the Windows 3.1 SDK, as mentioned in Q83456, which is so old that Microsoft doesn't even host it anymore.

Are message crackers deprecated and just not marked as such, or is their use still recommended? If they're deprecated, where/when was this announced? If their use is still recommended, then why aren't they documented anymore?

  • I too find it a strange oversight. I might have thought it something that got lost in the translation to learn.microsoft.com but I have a rather complete download of MSDN from shortly before they switched to learn.microsoft.com and there are only a few passing mentions to message crackers even then. I would not, however, worry that they are being removed, at least so long as the windows API is still a thing. – SoronelHaetir Jun 05 '22 at 22:35
  • 2
    I suspect MS wants them to fade into obscurity. They date back to a time when they needed to provide a way to handle, in particular, `WM_COMMAND` portably between 16 bit and 32 bit code. Thankfully, those days are now long behind us so they don't, IMO, serve any useful purpose anymore. They just serve to obscure what the code is actually doing and are yet another legacy API that MS have to maintain. – Paul Sanders Jun 05 '22 at 23:25
  • 3
    @PaulSanders Don't they still serve the useful purpose of keeping you from accidentally decoding the parameters the wrong way? – Joseph Sible-Reinstate Monica Jun 06 '22 at 00:31
  • 2
    True. I'm just used to the manual approach and just quickly look the message up in Google if I'm unsure. – Paul Sanders Jun 06 '22 at 07:09

0 Answers0