From: Jeppe Jakobsen Date: 2007-05-29T01:17:12+09:00 Subject: Re: interacting with another program Alexey Kalmykov wrote: > All you need is: > > 1) Find the program window (== get it's handle) by title > 2) Find the GUI control you want to work with (== get it's handle) > 3) Send message to this control (for example - to get text from text box > you need something like WM_GETTEXT message (see MSDN for details), to > push a button WM_LBUTTONDOWN,...) > > For step 1, 2 I cannot remember Win API functions by name, but you > shouldn't have any problems finding one (See MSDN, section about Window > functions). > > It's very brief explanation. If you have more specific question - feel > free to ask. 1) This should be the function to find the window handle: http://msdn2.microsoft.com/en-us/library/ms633499.aspx For this I also need the name of the class, but I have installed a tool that can show me that. 2) I couldn't find a function on MSDN to find a controls handle, so I'm kinda stuck on this one. Please help me out here. 3) To push a button I'll need BM_CLICK(http://msdn2.microsoft.com/en-us/library/ms673557.aspx)? For textfield i want to get the text from, I think I have to use EM_GETTEXTEX (http://msdn2.microsoft.com/en-us/library/ms652050.aspx) right? -- Posted via http://www.ruby-forum.com/.