Jeff Sholl

Any ideas on the best way to grab any selected test after pressing a global hotkey that I have registered

Any help would be greatly appreciated as always!

Thanks guys,

Jeff



Re: Windows SDK Get Selected text on a Global Hotkey press....

Sheng Jiang (?êÉ)

Any selected text I guess you need to enumerate every window and get text in the edit control windows by sending messages, however this is going to be VERY slow and other kind of controls may have selections too.






Re: Windows SDK Get Selected text on a Global Hotkey press....

Pintu Shukla


As mention is earlier post you have to perform peration on All the Window . First get the handle of window .then Call EnumChildWindow Procedure to get the handle of your Child Control and then search for edit control or control type in which you selected text .Then simple take the handle of that window and retrive the text from window

Thanx





Re: Windows SDK Get Selected text on a Global Hotkey press....

Viorel.

Maybe you should consider a way based on clipboard. First find the current window, probably with GetForegroundWindow or GetFocus functions. Then send the WM_COPY message and examine the clipboard. If this does not work for non-standard windows, then you probably have to simulate keys used usually for copy-to-clipboard operations, i.e. <Ctr+C>, with SendInput function. This way looks complicated but it is intended to work for both standard and specific (e.g. Word) windows. I hope this makes sense.





Re: Windows SDK Get Selected text on a Global Hotkey press....

Jeff Sholl

Thanks guys for the help!

Viorel, both those ideas worked quite while for windows like Word, but they didn't seem to work for selecting text in programs like Internet Explorer. Any idea on what I could put in my Global hotkey press to grab the selection from IE

Thanks,

Jeff