I have a windows application which should constantly keep track of the active application window.
I am yet to try it but I searched around and found that this could be done by using the windows API (user32.dll) - GetForegroundWindow()
But, my requirement also needs the application to look for any selected text or image in the active window (It could be a document, pdf, email, browser, mspaint etc). I am not sure how to do this. Is it possible to look for selected text or an image in the active window, and if found, then can it be retrieved to my application and used?
I am guessing if the selected text/image is obtained then I can copy it to the clip board and use it from my application because all applications have access to the clipboard.
Any thoughts? Any alternative/better ways to do this?