|
-
Jun 1st, 2001, 09:50 AM
#1
Read Text Globally
Say a user highlights some text on a web page how do i copy this selected text to clipboard from my app??? I know this is possible I've seen it done!
-
Jun 1st, 2001, 01:43 PM
#2
Use the SendMessage and send the WM_COPY message to the hwnd (use the WindowFromPoint API function to get the hwnd of which the mouse is over).
Code:
Private Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" (ByVal hwnd As Long, ByVal _
wMsg As Long, ByVal wParam As Long, lParam As Any) _
As Long
Private Const WM_COPY = &H301
Private Sub Command1_Click()
SendMessage hwnd, WM_COPY, 0, 0
End Sub
-
Jun 1st, 2001, 03:31 PM
#3
Ok I'm a little simple wanna go into more detail???
-
Jun 1st, 2001, 06:28 PM
#4
Good Ol' Platypus
But by the time they click on the button, the mouse will be over the button, making the hWnd returned that of the button, which will do nothing. You'll need to make a hotkey that does this.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jun 1st, 2001, 07:05 PM
#5
Even if you use a hotkey, there's no guaranteee that the mouse will be where you want it.
-
Jun 1st, 2001, 08:56 PM
#6
Perhaps a Timer to detect a MouseUp so that the user drags and selects text, than releases the mouse, copy whatever text is selected from the hwnd that the mouse is over.
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
|