How to add clipboard use to CHtmlView

First add menu item Edit, and then add Cut, Copy, Paste, and even Select All to this menu. Then add the handlers to your CHtmlView class.

Easy...



void CWebBrowserView::OnEditCut()
{ 
    ExecWB(OLECMDID_CUT, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); 
} 

void CWebBrowserView::OnEditCopy() 
{ 
    ExecWB(OLECMDID_COPY, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); 
} 

void CWebBrowserView::OnEditPaste() 
{ 
    ExecWB(OLECMDID_PASTE, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); 
} 

void CWebBrowserView::OnEditSelectall() 
{ 
    ExecWB(OLECMDID_SELECTALL, OLECMDEXECOPT_DONTPROMPTUSER, NULL, NULL); 
} 




Comments

  • There seems less people talk about CHtmlView

    Posted by timefinger on 12/02/2008 03:37am

    There seems less people talk about CHtmlView

    Reply
  • How can i get the selected text?

    Posted by Legacy on 05/07/2003 12:00am

    Originally posted by: biuliu

    in my project, I use ChtmlView to display the document. My question is when the user select some text in the ChtmlView How can i get how many character the user selected.
    If you know the solution, please eMail me (bubble601@hotmail.com)
    Thanks for advance!

    Reply
  • How can I find out whether there is anything selected?

    Posted by Legacy on 10/28/2002 12:00am

    Originally posted by: jondo

    I would need this for the ON_EDIT_COPY's ON_UPDATE_COMMAND_UI handler - to deactivate the menu item when there is nothing to copy.

    Reply
  • Using CHtmlView and an HTML file

    Posted by Legacy on 12/07/2001 12:00am

    Originally posted by: Rahi Parsi

    Hi all. I'm new to using the CHtmlView. I would like to know if there's any way to get form values from a web page?

    For example, let's say "login.html" has a form with a text field for the username. How do I get the value of that text field through C++ code?

    Thank you.

    Reply
  • How to save an URL to html file using CHtmlView?

    Posted by Legacy on 10/11/2001 12:00am

    Originally posted by: Oren Farber

    Hi

    I use CHtmlView that to view URL How can I save that URL into Html file ?



    Reply
  • It is a useful tip....

    Posted by Legacy on 10/06/2001 12:00am

    Originally posted by: SIMON

    that is a useful tip..

    Reply
  • How to find a word in a page

    Posted by Legacy on 02/23/2000 12:00am

    Originally posted by: virtu

    There are "Cut" , "Copy" , "Paste" , "Select All " and "Find a word in page" in the Edit Menu of IE, we can use ExecWB to execute the four functions, I don't know how to execute the fifth function(Find a word in page), does any one tell me how to do that?

    Thank you very much...

    Reply
  • Adding clipboard use to applet running in HTML page

    Posted by Legacy on 11/18/1999 12:00am

    Originally posted by: Katie King

    This solution works well for a plain HTML page running in CHTMLView window, but does not work for fields created/controlled by a java applet running in the page.
    Any ideas?

    Katie King
    KatieK@Keyfile.com

    Reply
Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: September 16, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you starting an on-premise-to-cloud data migration project? Have you thought about how much space you might need for your online platform or how to handle data that might be related to users who no longer exist? If these questions or any other concerns have been plaguing you about your migration project, check out this eSeminar. Join our speakers Betsy Bilhorn, VP, Product Management at Scribe, Mike Virnig, PowerSucess Manager and Michele …

  • Live Event Date: September 10, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Modern mobile applications connect systems-of-engagement (mobile apps) with systems-of-record (traditional IT) to deliver new and innovative business value. But the lifecycle for development of mobile apps is also new and different. Emerging trends in mobile development call for faster delivery of incremental features, coupled with feedback from the users of the app "in the wild". This loop of continuous delivery and continuous feedback is …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds