WM_POWERBROADCAST not received by message-only window in Windows XP

眉间皱痕 提交于 2019-12-23 03:51:50

问题


I'm trying to find out whether broadcast messages will be sent to message only windows, i.e. created as:

hWnd = CreateWindow(MAKEINTATOM(RegisterClass(&wnd)), NULL, 0, 0, 0, 0, 0, 0, HWND_MESSAGE, hInstance, 0);

Thing is that I don't get any broadcast messages to that window... ;)


回答1:


Your suspicions are correct. Message-only windows (those created by specifying HWND_MESSAGE for the hwndParent parameter of the CreateWindowEx function) do not receive broadcast notifications:

A message-only window enables you to send and receive messages. It is not visible, has no z-order, cannot be enumerated, and does not receive broadcast messages. The window simply dispatches messages.

Reference: MSDN



来源:https://stackoverflow.com/questions/5884622/wm-powerbroadcast-not-received-by-message-only-window-in-windows-xp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!