I've been struggling for a while now with retrieving the highlighted/selected text from any window. I've used: GetForegroundWindow GetCursorPos WindowFromPoint SendMessage(... GETTEXT...)/SendMessage(...GETSELTEXT...) It only really seems to work for Notepad. I can't get it to work with Word, IE, Firefox, etc.
Sure. I'm making a dictionary desktop utility so that whenever someone highlights text in any program and then presses the hotkeys, the selected text is captured by the utility and then processed. You may have seen them before with Babylon, Oxford's Russian Dictionary and I'm sure countless others. The workaround I'm using now is by emulating Ctrl-C but copying to the clipboard is a poor solution.