cwindowswinapiwindow-messages

Mysterious Window Message 0xc0e8 in Win32 Application


I am writing a Win32 application in C and have been monitoring the Window Messages coming through the message loop. I am getting an unknown message 0xc0e8 and cannot seem to find any information about this particular message. From my understanding all messages below 0x400 (WM_USER) are reserved by the system so I don't understand why I would be getting messages above that integer if I'm not sending any custom messages.

Does anyone know anything about this message and where it may be coming from?


Solution

  • Message 0xC0E8 is in the range of application-defined window messages that are registered at runtime with RegisterWindowMessage().

    Range Meaning
    0 through WM_USER –1 Messages reserved for use by the system.
    WM_USER through 0x7FFF Integer messages for use by private window classes.
    WM_APP through 0xBFFF Messages available for use by applications.
    0xC000 through 0xFFFF String messages for use by applications.
    Greater than 0xFFFF Reserved by the system.

    You can use GlobalGetAtomName() or GetClipboardFormatName() to retrieve the original name that was registered, that might give you a clue to which app registered it, as many apps tend to put their own names in the window messages they register. But that is not guaranteed.

    And there is no way to determine which application process actually registered the message originally, or is sending it to your app. 1

    1: well, not without hooking the RegisterWindowMessage() and (Post|Send)Message() functions in every running process, that is.

    You should not be concerning yourself with unknown messages, though. You could potentially receive many unknown messages during your process's lifetime. If you receive a message you don't recognize, simply pass it along to your default message handler (DefWindowProc(), etc) and move on.