windows message 之WM_COMMAND

2 篇文章 0 订阅

WM_COMMAND

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消息

WM_COMMAND 
wNotifyCode = HIWORD(wParam); // notification code 
wID = LOWORD(wParam);         // item, control, or accelerator identifier 菜单、按钮或者快捷键
hwndCtl = (HWND) lParam;      // handle of control 按钮句柄
Parameters
wNotifyCode
Value of the high-order word of wParam. Specifies the notification code if the message is from a control. If the message is from an accelerator, this parameter is 1. If the message is from a menu, this parameter is 0.
wParam的高字节,指定通知码是否来自一个按钮,当消息是来自一个快捷键时,这个值为1,如果来自菜单,则是0.
wID
Value of the low-order word of wParam. Specifies the identifier of the menu item, control, or accelerator.
wParam的低字节,指定菜单项、按钮或者快捷键的ID
hwndCtl
Value of lParam. Handle to the control sending the message if the message is from a control. Otherwise, this parameter is NULL.
lParam的值,当消息来自一个按钮时,句柄记录在lParam中,否则这个元素为NULL
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值