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.

该消息将会发送当前即将激活的窗口和即将被隐藏的窗口。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值