Selected Text
-
I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?
A.E.K
AFAIK that is impossible to know. There may be several items selected in several controls all over the place, and Windows does not know that. Selection is a matter internal to the Control or other object that supports it. You can interrogate the clipboard. You could start sending CTRL/C to different controls, and watch the clipboard. But a Control does not have to obey CTRL/C... :)
Luc Pattyn [Forum Guidelines] [My Articles]
this weeks tips: - make Visual display line numbers: Tools/Options/TextEditor/... - show exceptions with ToString() to see all information - before you ask a question here, search CodeProject, then Google
-
I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?
A.E.K
There's no way to tell and no API to call to tell you. There are simply too many different controls out there handling text is so many different ways. It's entirely up to the control containing the text in question. There's no standard method anyn control uses to expose this information.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?
A.E.K
A.E.K wrote:
I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?
Is the other application (2nd one) where the text is selected also a custom application? If it is you could use a standard Windows OS Message to notify your 1st application when text is selected.
Pete Soheil DigiOz Multimedia http://www.digioz.com
-
A.E.K wrote:
I need a way to determine whether a word (or character) is selected outside of my application or not do we have any appropriate API function for this purpose?
Is the other application (2nd one) where the text is selected also a custom application? If it is you could use a standard Windows OS Message to notify your 1st application when text is selected.
Pete Soheil DigiOz Multimedia http://www.digioz.com
i agreed with him and want to add some more clarification in these comments that if other application is custome application and you have the source available then you can raise an event for the selection you have made. Hope you got the idea.
Be a part of solution, rather then be a part of problem
-
i agreed with him and want to add some more clarification in these comments that if other application is custome application and you have the source available then you can raise an event for the selection you have made. Hope you got the idea.
Be a part of solution, rather then be a part of problem
-
A.E.K wrote:
Nope. it should work every where. thanks everybody.
That can not be easily done, and you shouldn't need to do something like that either for a typical application. Perhaps you need to reconsider your application design?
Pete Soheil DigiOz Multimedia http://www.digioz.com