window control id

 

[in] Handle to a menu, or specifies a child-window identifier depending on the window style. For an overlapped or pop-up window,  hMenu identifies the menu to be used with the window; it can be NULL if the class menu is to be used. For a child window,  hMenu specifies the child-window identifier, an integer value used by a dialog box control to notify its parent about events. The application determines the child-window identifier; it must be unique for all child windows with the same parent window. 

MSDN中说it must be unique for all child windows with the same parent window. 如果child window id相同会怎么样呢?
ID相同的话,影响的是父窗口接受到notify消息时,id是一样的.区分不了到底是哪个窗口.另外ID如果相同的话,一些notify消息可能不通知父窗口,比如WM_MEASUREITEM消息

This message is sent to the owner window of an owner-drawn button or menu item when the control or menu is created.

When the owner window receives the WM_MEASUREITEM message, the owner fills in the MEASUREITEMSTRUCTstructure pointed to by the lParam parameter of the message and returns; this informs the system of the dimensions of the control. If a list box or combo box is created with the LBS_OWNERDRAWVARIABLE or CBS_OWNERDRAWVARIABLE style, this message is sent to the owner for each item in the control; otherwise, this message is sent once. 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值