Context menu in CHtmlView question.
-
I tried to use OnContextMenu and OnRButtonDown to popup the context menu when click right mouse button in a CHtmlView class. When I test it, no menu popup. How to fix it? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)
-
I tried to use OnContextMenu and OnRButtonDown to popup the context menu when click right mouse button in a CHtmlView class. When I test it, no menu popup. How to fix it? Thanks. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)
OnContextMenu and OnRButtonDown are MFC command handlers. The trouble is that CHtmlView derives from a CView but provides no real support for it. CHtmlView is basically a wrapper around the web browser ActiveX control. You can check out yourself by the way because we have all the code for it. So all right clicks are in fact consumed by the ActiveX. The good news is that the web browser control has a mechanism to supersede context menus. You have to implement the IDocHostUIHandler interface. You have built-in samples in MSDN library. (and even in codeproject as far as I remember).
-
OnContextMenu and OnRButtonDown are MFC command handlers. The trouble is that CHtmlView derives from a CView but provides no real support for it. CHtmlView is basically a wrapper around the web browser ActiveX control. You can check out yourself by the way because we have all the code for it. So all right clicks are in fact consumed by the ActiveX. The good news is that the web browser control has a mechanism to supersede context menus. You have to implement the IDocHostUIHandler interface. You have built-in samples in MSDN library. (and even in codeproject as far as I remember).
Thank you. It's a good point. mIchAel Liu __________________________________________________________ The secret of business is to know something that nobody else knows. ;)