共用方式為


CWindow::PostMessage

在訊息佇列將訊息與建立 Windows Form 的執行緒。

BOOL PostMessage(
   UINT message,
   WPARAM wParam = 0,
   LPARAM lParam = 0 
) throw();

備註

請參閱在 Windows SDK的 PostMessage

沒有任何等候的執行緒傳回處理訊息。

範例

//The following example attaches an HWND to the CWindow object and 
//posts a WM_PAINT message to the Window wrapped by the CWindow object 
//using CWindow::PostMessage() with the default values of WPARAM and 
//LPARAM

CWindow myWindow;
myWindow.Attach(hWnd);
myWindow.PostMessage(WM_PAINT);

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::SendMessage

CWindow::SendNotifyMessage