Find the original name of the message received using the RegisterWindowMessage API

When debugging an application in an attempt to improve performance, I found that it wastes time processing a message that is greater than 0xC000. This is obviously a post created by the API RegisterWindowMessage. However, the application uses more than two hundred such messages; Is there a way to find the original name of the message by its numerical value?

Failure GetAtomNameand GlobalGetAtomNamewith

ERROR_INVALID_HANDLE

error.

+4
source share
1 answer

There is no official API to get the name of a registered window message.

RegisterWindowMessage() RegisterClipboardFormat() ( API), Windows GetClipboardFormatName(), .

Raymond Chen MSDN:

(RegisterClass)?

, Windows , . , , , . , .

, :

Foreach atom in (0xC000 .. 0xFFFF)
  If (GetClipboardFormatName(atom, buffer, bufferSize))
    Print buffer

, . 16 384 , , , 15 000 , , .

( 0xC000)

, RegisterWindowMessage. ; , 0xC000 0xFFFF, . , , - . , , . .

, RegisterClipboardFormat, ; UINT. ; 0xC000, . - , 0x1234, .

, , API, , , , . GetClipboardFormatName() , , RegisterWindowMessage() - .

+6

Source: https://habr.com/ru/post/1695487/


All Articles