SendMessage為什么能發送給其他行程的視窗,而且如果另一個行程正在呼叫視窗函式,還沒有執行完,這時候給那個行程的視窗發送SendMessage,這時候那個行程會同時執行兩個視窗函式嗎,函還是先等那個行程當前的視窗函式執行完才去執行SendMessage發送的視窗函式
uj5u.com熱心網友回復:
If the specified window was created by the calling thread, the window procedure is called immediately as a subroutine. If the specified window was created by a different thread, the system switches to that thread and calls the appropriate window procedure. Messages sent between threads are processed only when the receiving thread executes message retrieval code. The sending thread is blocked until the receiving thread processes the message.uj5u.com熱心網友回復:
InSendMessage
The InSendMessage function determines whether the current window procedure is processing a message that was sent from another thread (in the same process or a different process) by a call to the SendMessage function.
BOOL InSendMessage(VOID);
Parameters
This function has no parameters.
Return Values
If the window procedure is processing a message sent to it from another thread using the SendMessage function, the return value is nonzero.
If the window procedure is not processing a message sent to it from another thread using the SendMessage function, the return value is zero.
uj5u.com熱心網友回復:
The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message.The PostMessage function places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread to process the message.
uj5u.com熱心網友回復:
可以,這個回復,謝了老哥
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/21868.html
標籤:界面
