宏定义WM_COMM 为用户自定义消息,不更改消息映射的. 下面摘自MSDN: The WM_USER constant is used by applications to help define private messages, usually of the form WM_USER+X, where X is an integer value. There are five ranges of message numbers: Range Meaning 0 through WM_USER – 1 Messages reserved for use by the system. WM_USER through 0x7FFF Integer messages for use by private window classes. WM_APP through 0xBFFF Messages available for use by applications. 0xC000 through 0xFFFF String messages for use by applications. Greater than 0xFFFF Reserved by the system for future use.
#define WM_COMM WM_USER+100 =============================== 因为 windwos 对小于 WM_USER 的消息认为 windows 系统消息,故自定义消息要 >= WM_USER SO,人们一般用 WM_USER 或 WM_USER+上某个值 表明“这是不是一个 WINDOWS 系统消息”当然,自定义消息有最大值的.
下面摘自MSDN:
The WM_USER constant is used by applications to help define private messages, usually of the form WM_USER+X, where X is an integer value. There are five ranges of message numbers: Range Meaning
0 through WM_USER – 1 Messages reserved for use by the system.
WM_USER through 0x7FFF Integer messages for use by private window classes.
WM_APP through 0xBFFF Messages available for use by applications.
0xC000 through 0xFFFF String messages for use by applications.
Greater than 0xFFFF Reserved by the system for future use.
===============================
因为 windwos 对小于 WM_USER 的消息认为 windows 系统消息,故自定义消息要 >= WM_USER
SO,人们一般用 WM_USER 或 WM_USER+上某个值 表明“这是不是一个 WINDOWS 系统消息”当然,自定义消息有最大值的.
消息映射是把你定义的消息和对消息的处理的函数挂钩啊
因为windows基于消息循环的,所以只要你向系统发送你定义的消息,系统就会自动调用与此消息相关的处理函数
我是这么理解的
================
当然可以,不过不能与已有重复吧(名称及WM_USER + x中的 x)
楼主可以参考自定义消息的相关文章。