|
-
Jul 7th, 2001, 04:40 PM
#1
Thread Starter
Member
Webbrowser control - Detecting Selected Text event
Does anyone know how to detect when inside the webbrowser control that a user has selected text?
The only way I know how to (force the system to press Ctrl+C and check the contents of clipboard) does not work in my program correctly since other events occur at the same time that hinder its correct operation.
Suggestions?
-
Jul 7th, 2001, 05:02 PM
#2
Not possible
-
Jul 7th, 2001, 05:16 PM
#3
Thread Starter
Member
Soultion found
After struggling for an afternoon... I found out a very close simulation....
Instead of forcing Ctrl+C into the system (using the USER32 keybd_event command), use a combination of two things:
MFC Copy command:
WebBrowser.ExecWB OLECMDID_COPY, OLECMDEXECOPT_DODEFAULT
Clipboard Type Detection:
And because we are looking for a text, not binary data, use Clipboard.GetText to detect the type of Clipboard data afterward...
Then use the same strategy: check the clipboard to see if it is non-null.. if it's null... no text has been selected... if it is non-null, text is selected.
Close as I can get.
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
|