共用方式為


CWindow::SendMessage

將訊息傳送至視窗,而且不會傳回,直到的視窗程序來處理訊息。

LRESULT SendMessage(
   UINT message,
   WPARAM wParam = 0,
   LPARAM lParam = 0 
) throw();
static LRESULT SendMessage(
   HWND hWnd,
   UINT message,
   WPARAM wParam,
   LPARAM lParam 
) throw();

備註

請參閱在 Windows SDK的 SendMessage

範例

// The following example attaches a HWND to the CWindow
// object and sends a WM_PAINT message to the window
// wrapped by CWindow object using CWindow::SendMessage.

CWindow myWindow;
myWindow.Attach(hWnd);   
myWindow.SendMessage(WM_PAINT, 0L, 0L);

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::PostMessage

CWindow::SendNotifyMessage

CWindow::SendMessageToDescendants