Home » SQL ServerRSS

chtmlview, how to implement this function

I have to show different menu above different element. such as, right click over anchor, image, textarea. I want to know how to tell which kind of element under the mouse.

And, if users has selected a few words, the menu should be "copy, select all...", how can I know the selected status in the view.

 

2 Answers Found

 

Answer 1

Override CHtmlView::OnShowContextMenu and compare dwID to CONTEXT_MENU_IMAGE or CONTEXT_MENU_ANCHOR.

The selection is available from the document. Call GetHtmlDocument to get the document, UI for IHTMLDocument2 and get the selection via IHTMLDocument2::get_selection 

 

Answer 2

Thanks very much!

It is solved.

 
 
 

<< Previous      Next >>


Microsoft   |   Windows   |   Visual Studio   |   Tech Videos   |   Follow us on Twitter