WM_USER vs WM_APP

前端 未结 2 842
醉酒成梦
醉酒成梦 2020-12-17 18:31

I want the worker threads to send a user-defined message to the UI thread message queue, but I am not sure if I should use WM_USER or WM_APP. The d

2条回答
  •  天涯浪人
    2020-12-17 19:30

    If you completely control the window class of the destination window (i.e. you defined it, you're not subclassing/superclassing another class, and you don't use IsDialogMessage on your window) then you can use WM_USER+xxx (with x >= 0).

    Otherwise, you should use at least WM_APP+xxx, provided you control the application that contains the window.

    Failing that, the only option left would be RegisterWindowMessage().

提交回复
热议问题