WM_COMMAND和WM_SYSCOMMAND消息的区别

WM_COMMAND Notification

The WM_COMMAND message is sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated.

所以WM_COMMAND消息会在以下3中情况触发

当用户从菜单中选择了一个命令项
当一个控件向其父窗口发送了一条通知消息
当一个加速键被翻译
WM_COMMAND 消息被发送

WM_SYSCOMMAND Notification

A window receives this message when the user chooses a command from the Window menu (formerly known as the system or control menu) or when the user chooses the maximize button, minimize button, restore button, or close button.

当用户从窗口菜单选择了一命令项或当用户选择了“最大化”、“最小化”按钮时,窗口会收到这个消息

 

你可能感兴趣的:(职场,休闲,WM_COMMAND,WM_SYSCOMMAND)