Peeping Tom
-
I would like to get access to the chat area of a commercial application so i can retrieve the text for analysis ... WITHOUT using the mouse. Currently, i am accessing the text, successfully, by smulating mouse-clicks in the commercial application's chat area, and using SendInput (-c) to put the data in the clipboard, once every 30 seconds. But that technique has two bad side effects ... it steals the cursor for a split second, and it uses the clipboard in a VERY non-standard way. I am hoping that there is a way for me to get the data by going directly into the chat control of the target window. I have the handle to the window but i am not very knowledgeable about the structure of windows and child controls of a window, so i don't know how to approach the problem this way. Please advise, or point me to an understandable explanation ... lol ... of how to do that. (I tried the MSDN libraries and i could not get a clue.) I am also open to any alternative ideas. Thank you very very much.
-
I would like to get access to the chat area of a commercial application so i can retrieve the text for analysis ... WITHOUT using the mouse. Currently, i am accessing the text, successfully, by smulating mouse-clicks in the commercial application's chat area, and using SendInput (-c) to put the data in the clipboard, once every 30 seconds. But that technique has two bad side effects ... it steals the cursor for a split second, and it uses the clipboard in a VERY non-standard way. I am hoping that there is a way for me to get the data by going directly into the chat control of the target window. I have the handle to the window but i am not very knowledgeable about the structure of windows and child controls of a window, so i don't know how to approach the problem this way. Please advise, or point me to an understandable explanation ... lol ... of how to do that. (I tried the MSDN libraries and i could not get a clue.) I am also open to any alternative ideas. Thank you very very much.
Ok, supposing you're trying to do this for a something legal, first you have to use Spy++ to find the text control in the window hierarchy. Then you could use EnumChildWindows as many times as required to get the Edit control (that's the way they are called in the Windows API :)) handle, and send it a
WM_GETTEXT
message. But since the other app probably isn't written in .NET, you're better off using the Win32 API. If it's a regular text box coontrol, it's actually rather easy. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
-
Ok, supposing you're trying to do this for a something legal, first you have to use Spy++ to find the text control in the window hierarchy. Then you could use EnumChildWindows as many times as required to get the Edit control (that's the way they are called in the Windows API :)) handle, and send it a
WM_GETTEXT
message. But since the other app probably isn't written in .NET, you're better off using the Win32 API. If it's a regular text box coontrol, it's actually rather easy. -- LuisR
Luis Alonso Ramos Intelectix - Chihuahua, Mexico Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
Thanks, Luis You are right .. it was easy ... 2 statements ... after i spent 16 hours trying to get the compiler to accept my SendMessage statement ... ... but what the heck .. i learned a LOT about DLLs, SPY++, and overrides in the process :) Thanks, again, for your response.
-
Thanks, Luis You are right .. it was easy ... 2 statements ... after i spent 16 hours trying to get the compiler to accept my SendMessage statement ... ... but what the heck .. i learned a LOT about DLLs, SPY++, and overrides in the process :) Thanks, again, for your response.
I'm glad I could help! :) It feels nice when after a lot of hours you finally manage to do something and then think "next time it'll take me 5 minutes" :) The good thing is that you learned a lot. Altough with .NET some may say that Win32 is becoming obsolete for everything but some low-level tasks, I've found many times that good knowledge of it can save you even in the managed world!
Luis Alonso Ramos Intelectix Chihuahua, Mexico
Not much here: My CP Blog!