|
-
September 21st, 2001, 02:00 PM
#1
Copying Text
I have an app that runs in the background all the time. If IE is open and the hotkey(F2) is pressed
my app becomes visible. I need some help in one area though. I need to copy text that is highlighted
on the web page into a textbox on my form. Can anyone tell me how to do this? I have tried and
tried but have not had any success.
Thanks for any help provided. All posts that help me with this problem will be rated.
Kris
Software Engineer
Phoenix,AZ
Kris
Software Engineer
Phoenix, AZ USA
-
September 25th, 2001, 04:49 AM
#2
Re: Copying Text
Obtain a window handle to Explorer and before you bring your application to the foreground send it a WM_COPY message with the SendMessage API call.
If any text is selected it will be copied to the clipboard.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
September 25th, 2001, 10:08 AM
#3
Re: Copying Text
I tried that exactly as you have described and it does not work. I know I had the correct hWnd to
the window because I could change the window title bar text. I have figured out a different
way to do this. I added my program to the right click menu of IE and used javascript to get the
highlighted text then open my app and pass the text as a command line argument. Works great.
Kris
Software Engineer
Phoenix,AZ
Kris
Software Engineer
Phoenix, AZ USA
-
September 25th, 2001, 10:22 AM
#4
Re: Copying Text
Hmm - does Sendkeys "^C" work?
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Check out the new downloads - ImageMap.ocx is the VB control that emulates an HTML image map, EventVB.OCX for adding new events to your VB form and adding System Tray support simply, MCL Hotkey for implemenmting system-wide hotkeys in your application...all with source code included.
-
September 25th, 2001, 10:56 AM
#5
Re: Copying Text
Nope that didn't work either. I tried several different ways but no luck. The JavaScript works
great though.
Kris
Software Engineer
Phoenix,AZ
Kris
Software Engineer
Phoenix, AZ USA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|