An application typically uses the return value to determine whether to end the main message loop and exit the program. The GetMessage function retrieves messages associated with the window identified by the hWnd parameter or any of its children, as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. Note that an application can only use the low word in the wMsgFilterMin and wMsgFilterMax parameters; the high word is reserved for the system.Note that GetMessage always retrieves WM_QUIT messages, no matter which values you specify for wMsgFilterMin and wMsgFilterMax.During this call, the system delivers pending messages that were sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. The system may also process internal events. Messages are processed in the following order: Sent messages
Posted messages
Input (hardware) messages and system internal events
Sent messages (again)
WM_PAINT messages
WM_TIMER messages 其中的这一段:
During this call, the system delivers pending messages that were sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. The system may also process internal events. Messages are processed in the following order: Sent messages
Posted messages
Input (hardware) messages and system internal events
Sent messages (again)
WM_PAINT messages
WM_TIMER messages 我想问的是sendmessage的消息不进入消息队列, 直接在getmessage的时候处理了??? 这个理解对码.Sent messages (again) 是什么意思??
Posted messages
Input (hardware) messages and system internal events
Sent messages (again)
WM_PAINT messages
WM_TIMER messages 其中的这一段:
During this call, the system delivers pending messages that were sent to windows owned by the calling thread using the SendMessage, SendMessageCallback, SendMessageTimeout, or SendNotifyMessage function. The system may also process internal events. Messages are processed in the following order: Sent messages
Posted messages
Input (hardware) messages and system internal events
Sent messages (again)
WM_PAINT messages
WM_TIMER messages 我想问的是sendmessage的消息不进入消息队列, 直接在getmessage的时候处理了??? 这个理解对码.Sent messages (again) 是什么意思??
解决方案 »
- 打开指定文件夹位置
- 如何使用opencv读取视频,并同时获取前后两帧视频,然后应用这两帧视频进行操作?
- VC中如何删除文件?
- 两个程序调用的问题
- 如何隐蔽窗口!
- 用vc6.0如何获取一个表中的字段名?
- 关于消息的问题?
- 在vc6的安装向导中如何将应用程序的 dll文件放进去
- 高分请教:ADO调用存储过程,参数传递顺序导致数据类型转换错误
- 如何在EVC中创建一个URL链接,并通过此链接向服务器发送信息?
- [串口]为什么我的串口Read事件在空字符情况下也会有信号?
- First-chance exception in ProServer.exe (KERNEL32.DLL): 0xC0000005: Access Violation.
与GetMessage没有关系
msdn2005是这样的
Res
An application typically uses the return value to determine whether to end the main message loop and exit the program. The GetMessage function only retrieves messages associated with the window identified by the hWnd parameter or any of its children, as specified by the IsChild function, and within the range of message values given by the wMsgFilterMin and wMsgFilterMax parameters. If hWnd is NULL, GetMessage retrieves messages for any window that belongs to the calling thread and thread messages posted to the calling thread by means of PostThreadMessage. GetMessage does not retrieve messages for windows that belong to other threads nor for threads other than the calling thread, even if hWnd is not NULL. Thread messages, posted by the PostThreadMessage function, have a message hWnd value of NULL. If wMsgFilterMin and wMsgFilterMax are both zero, GetMessage returns all available messages (that is, no range filtering is performed). The WM_KEYFIRST and WM_KEYLAST constants can be used as filter values to retrieve all messages related to keyboard input; the WM_MOUSEFIRST and WM_MOUSELAST constants can be used to retrieve all mouse messages. If the wMsgFilterMin and wMsgFilterMax parameters are both zero, the GetMessage function returns all available messages (that is, without performing any filtering). GetMessage does not remove WM_PAINT messages from the queue. The messages remain in the queue until processed. Note that the function return value can be nonzero, zero, or –1. Thus, you should avoid code like this.while (GetMessage( lpMsg, hWnd, 0, 0)) ...
The possibility of a –1 return value means that such code can lead to fatal application errors.