Popiel
Popiel

Reputation: 193

C - WinAPI - send message to thread and wait for it

I want to send a message in WinAPI to window, created in other thread and then wait for process this message.

Is this possible? Thanks in advance.

Upvotes: 1

Views: 1150

Answers (1)

alk
alk

Reputation: 70883

Use SendMessage() to send a message to a window.

SendMessage() blocks the calling thread until the message had been delivered and processed by the target window's message dispatcher.

From 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.

Upvotes: 3

Related Questions