WM_CONTEXTMENU percolate upward

在学习Windows.Programming Windows with MFC, 2nd Edition时,看到第四章Menus的Menu Magic中的Context Menus小节。有一段话有些费解:

写道
If necessary, you can translate the screen coordinates passed in point into client coordinates with CWnd::ScreenToClient. It might seem curious that OnContextMenu receives a pointer identifying a window since mouse messages go to the window under the cursor. However, there's a reason. Unlike other messages, WM_CONTEXTMENU messages percolate upward through the window hierarchy if a right-click occurs in a child window (for example, a push button control) and the child window doesn't process the message. Therefore, if a window contains child windows, it could receive WM_CONTEXTMENU messages with pWnd containing a pointer to one of its children.

 多读了几遍,GOOGLE了一下,

 

http://newdata.box.sk/bx/c/htm/ch13.htm#Heading6

 

发现这篇文章有个“percolating upward”。呵呵,一下子明白了,不久是说“向上转型”吗。

 

相应的“percolate upward through ”,不就是说“WM_CONTEXTMENU消息从子窗口传递到父窗口,子窗口执行该消息”。

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值