Creating custom message types in win32?

后端 未结 3 1990
野的像风
野的像风 2021-02-08 13:04

Is there a way to define and send custom message types in Win32, to be caught by your Main message handler? For example, my main message handler captures messages such as WM_PAI

3条回答
  •  温柔的废话
    2021-02-08 13:37

    Yes. Just declare a constant in the WM_USER range e.g.

    #define WM_RETICULATE_SPLINES (WM_USER + 0x0001)
    

    You can also register a message by name using the RegisterWindowMessage API.

    You can then send these messages using SendMessage, PostMessage or any of their variants.

提交回复
热议问题