`
reymont
  • 浏览: 526330 次
  • 性别: Icon_minigender_1
  • 来自: 深圳
社区版块
存档分类
最新评论

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消息从子窗口传递到父窗口,子窗口执行该消息”。

 

 

 

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics