LRESULT SendMessage(
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
HWND hWnd, // handle of destination window
UINT Msg, // message to send
WPARAM wParam, // first message parameter
LPARAM lParam // second message parameter
);
CWnd::SendMessage
LRESULT SendMessage( UINT message, WPARAM wParam = 0, LPARAM lParam = 0 );Sends the specified message to this window. The SendMessage member function calls the window procedure directly and does not return until that window procedure has processed the message. This is in contrast to the PostMessage member function, which places the message into the window’s message queue and returns immediately. 2.
CWnd::OnChildNotify
virtual BOOL OnChildNotify( UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pLResult );This member function is called by this window’s parent window when it receives a notification message that applies to this window.Never call this member function directly.
例:
GetOwner()->SendMessage(WM_COMMAND,IDD_BUTTON,0);
就可以发送一个消息。
例:
GetOwner()->SendMessage(WM_COMMAND,IDD_BUTTON,0);
就可以发送一个消息。
广播式发送一个KEYDOWN消息
SendMessage(WM_SYSCOMMAND,SC_SCREENSAVE,0);
击活屏保
详细参数及用法请参见MSDN