in reply to Is GUITest SetForegroundWindow/Sendkey thread safe?
My tips ideas
Well, learn to enumerate processes by pid and/or to associate pids with windows, (see TidPid GetWindowThreadProcessId, see Win32::FindWindow, patch GuiTest.xs, Win32::GUI::GetWindowThreadProcessId())
and use PostMessage() for everything that GuiTest doesn't already have a wrapper for (example Win32::GUIRobot says CloseWindow $HWND Sends close signal to a window. ),
and fix hwndSendKeys so you can send keys without corruption (not capslocks and other global state stuff -- not Ctrl+F4 when you have CloseWindow -- just the keys you need),
and use autoit to fill in the blanks ( FWIW, if you look at http://search.cpan.org/~shimi/Win32-Watir-0.06-withoutworldwriteables/MANIFEST or Win32::IEAutomation you can see they're using AutoIt COM interface from perl :)
Does this make sense?
more generic win32 tips
If you want to automate anything on win32 you have to absorb the following knowledge . It mostly consists of learing the ole/excel/powerpoint... object model, and using Win32::OLE to call it or sending messages using guitest. OLE is essentially a fancy/standardised way of sending messages. Its very much like web-scraping, you have to know HTTP/HTML DOM .... the rest is just legwork
|
|---|