Home > Enterprise >  what is the window message 49373 (0xC0DD) in windows?
what is the window message 49373 (0xC0DD) in windows?

Time:06-26

i'm using spyxx on w10 to monitor messages received by the window i created from my app and i noticed this row in the log:

<000011> 00000000000A 1022 P message:0xC0DD [Registrato:"TaskbarButtonCreated"] wParam:00000000 lParam:00000000

if you're asking yourself what is "registrato" consider that it is the italian word for "registered", now my question is what is this message and what is its purpose? i also searched in the same header file where other IDs are defined into but i couldn't find any message with that value

CodePudding user response:

0xC0DD is in the range of window messages that are "registered" by applications at runtime via RegisterWindowMessage():

If the message is successfully registered, the return value is a message identifier in the range 0xC000 through 0xFFFF.

Per MSDN documentation:

The following are the ranges of message numbers.

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 (0x8000) through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system.

Message numbers in the first range (0 through WM_USER –1) are defined by the system. Values in this range that are not explicitly defined are reserved by the system.

Message numbers in the second range (WM_USER through 0x7FFF) can be defined and used by an application to send messages within a private window class. These values cannot be used to define messages that are meaningful throughout an application because some predefined window classes already define values in this range. For example, predefined control classes such as BUTTON, EDIT, LISTBOX, and COMBOBOX may use these values. Messages in this range should not be sent to other applications unless the applications have been designed to exchange messages and to attach the same meaning to the message numbers.

Message numbers in the third range (0x8000 through 0xBFFF) are available for applications to use as private messages. Messages in this range do not conflict with system messages.

Message numbers in the fourth range (0xC000 through 0xFFFF) are defined at run time when an application calls the RegisterWindowMessage function to retrieve a message number for a string. All applications that register the same string can use the associated message number for exchanging messages. The actual message number, however, is not a constant and cannot be assumed to be the same between different sessions.

Message numbers in the fifth range (greater than 0xFFFF) are reserved by the system.

In this case, the value you are seeing is the result of the Taskbar calling RegisterWindowMessage("TaskbarButtonCreated"). The purpose of this message, as you can inter from its name, is to notify your app when your window's Taskbar button has been created:

Taskbar Extensions

When an application displays a window, its taskbar button is created by the system. When the button is in place, the taskbar sends a TaskbarButtonCreated message to the window. Its value is computed by calling RegisterWindowMessage(L("TaskbarButtonCreated")). That message must be received by your application before it calls any ITaskbarList3 method.

If you use the ITaskbarList3 interface in your code to interact with your Taskbar button (ie, to display progress status, etc), you need to register this message at runtime and wait for it to arrive in your window's message handler procedure before you can then safely call the interface's methods to manipulate your window's Taskbar button.

  • Related