Windows XP 中的纯消息窗口未接收到 WM_POWERBROADCAST

发布于 11-05 15:21 字数 202 浏览 7 评论 0原文

我试图找出广播消息是否会发送到仅消息窗口,即创建为:

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

问题是我没有收到任何广播消息到该窗口...;)

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... ;)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

回梦2024-11-12 15:21:03

你的怀疑是正确的。仅消息窗口(通过为 CreateWindowEx 函数的 hwndParent 参数指定 HWND_MESSAGE 创建的窗口)不会接收广播通知:

纯消息窗口使您能够发送和接收消息。它不可见,没有 z 顺序,无法枚举,并且不接收广播消息。窗口只是发送消息。

参考:MSDN

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文