Hello.
I am working on application that needs to get selected text from another application. I can get the text from most applications using SendMessage with sending WM_COPY as message, so the application can copy the selection at the clipboard. I can send WM_GETTEXT, EM_GETSEL messages to get the text directly in some cases, but neither works in excel for some reason.
So, i need some way to get the selected text in excel, or any solution that will work with any application. My approach works in 99% of the cases, but it needs to work with excel, and it doesnt.
Before i substring the string, i am getting the workbook name instead the actual text. Like, Book1 or whatever it is. Now, because of that, i assume that my handle is not the one it's supposed to be, but i can seem to get the correct one.
So, if anyone has an idea of how to obtain the selected text from any application that has the focus and has some selected text, or just the valid handle for the excel worksheet, please help.
Thanks in advance :-)