Windows在各種情況下的響應的消息(大集合)-【學習札記】

參考地址:http://msdn.microsoft.com/en-us/library/dd469354(VS.85).aspx

 

1.WM_NULL

The WM_NULL message performs no operation. An application sends the WM_NULL message if it wants to post a message that the recipient window will ignore.

A window receives this message through its WindowProc function

此消息代表不執行任何操作,當應用程序發送此消息給應用窗口將被忽略,窗口通過調用WindowProc函數窗口過程來接收此此消息

 

For example, if an application has installed a WH_GETMESSAGE hook and wants to prevent a message from being processed, the GetMsgProc callback function can change the message number to WM_NULL so the recipient will ignore it.

As another example, an application can check if a window is responding to messages by sending the WM_NULL message with the SendMessageTimeout function

例如,如果一個應用程序安裝了一個WH_GETMESSAGE掛鉤,並要防止信息被處理後,GetMsgProc回調函數可以更改郵件數量WM_NULL這樣接受者將忽略它。

 

另一個例子是,應用程序可以檢查一個窗口,是通過發送響應與SendMessageTimeout函數WM_NULL信息的郵件

 

2.WM_CREATE

The WM_CREATE message is sent when an application requests that a window be created by calling the CreateWindowEx or CreateWindow function. (The message is sent before the function returns.) The window procedure of the new window receives this message after the window is created, but before the window becomes visible.

A window receives this message through its WindowProc function.

當使用窗口創建函數CreateWindowEx or CreateWindow 時會產生(這個消息發送在函數返回值之前)。新建窗口會在創建之後顯示出此窗口之前接收到這個消息。

 

3.DESTROY

The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window procedure of the window being destroyed after the window is removed from the screen.

This message is sent first to the window being destroyed and then to the child windows (if any) as they are destroyed. During the processing of the message, it can be assumed that all child windows still exist.

當窗口從屏幕清除之前發送給窗口程序。這個消息會首先發給被銷燬窗口再到子窗口(如果有的話),在處理這個消息的過程中子窗口可以說是仍然存在的。

 

If the window being destroyed is part of the clipboard viewer chain (set by calling the SetClipboardViewer function), the window must remove itself from the chain by processing the ChangeClipboardChain function before returning from the WM_DESTROY message.

如果窗口被銷燬的剪貼板查看器鏈的一部分(通過調用SetClipboardViewer功能集),在窗口必須刪除處理ChangeClipboardChain函數本身之前從鏈從WM_DESTROY消息返回。

 

4.WM_MOVE

窗口移動時產生。

 

5.WM_SIZE

窗口大小發送改變時產生

If the SetScrollPos or MoveWindow function is called for a child window as a result of the WM_SIZE message, the bRedraw or bRepaint parameter should be nonzero to cause the window to be repainted.

 

當子窗口引用SetScrollPos or MoveWindow函數時引發一個WM_SIZE消息時,參數bRedraw or bRepaint 在窗口重畫時必須保持非零。

 

6.WM_ACTIVATE

The WM_ACTIVATEAPP message is sent when a window belonging to a different application than the active window is about to be activated. The message is sent to the application whose window is being activated and to the application whose window is being deactivated.

該消息將會發送當前即將激活的窗口和即將被隱藏的窗口。

發佈了29 篇原創文章 · 獲贊 3 · 訪問量 5萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章