View Single Post
 
Old 10-27-2017, 04:53 PM
Steve Steve is offline
Junior Member
 
Join Date: Oct 2015
Posts: 3
Default Problem copying selected text from TWebBrowser in Pdf viewing mode.

Hi, I'm using TWebBrowser as a pdf viewer, and I need to be able to copy selected text with code. If I press control C on my keyboard it copies to the clipboard with no problems, but it won't copy when using any of the keypress simulation techniques - even when selecting text on a web page in TWebBrowser.

I've tried: keybd_event, SendInput and this code here: http://www.tek-tips.com/viewthread.cfm?qid=899078. I also have a memo on the form and those three methods all copy from the memo without any problems.

I've checked for focus issues by pressing control C on the keyboard with TWebBrowser in the same state of focus as with the simulator code (I used a TTimer to delay the code and I made the selection in TWebBrowser with the mouse before the code activated).

Thanks for any help. Steve.
Reply With Quote