我想在 WinAPI 中发送一条消息到在其他线程中创建的窗口,然后等待处理这条消息。
这可能吗?提前致谢。
最佳答案
使用 SendMessage()
向窗口发送消息。
SendMessage()
阻塞调用线程,直到消息被目标窗口的消息调度程序并处理。
来自 SendMessage()
's documentation :
Sends the specified message to a window or windows. The SendMessage function calls the window procedure for the specified window and does not return until the window procedure has processed the message.
关于C - WinAPI - 向线程发送消息并等待它,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23982448/