SendMessage(HWND_BROADCAST, …) hangs

后端 未结 4 1427
鱼传尺愫
鱼传尺愫 2020-12-14 19:11

When I use theSendMessage function with HWND_BROADCAST, the application hangs up. There is no response from the application for long time.

4条回答
  •  孤街浪徒
    2020-12-14 19:49

    There is at least one process out there that has a message pump but isn't pumping messages. SendMessage doesn't return until all receivers have processed the message... so it doesn't return. You can try using SendMessageTimeout instead to get around this.

    Incidentally, this is why launching a process and waiting on its process handle can be fraught with problems. I describe this on my website here.

提交回复
热议问题