Jump to content

Complex window automation with AutoIT

Recommended Posts

It's an obvious question, but I can't find anything related in google, only it shows me is EnumChildWindow and others WinAPI functions.

I'm writing a simple script that should send escape key to application (sound pretty easy). But here is a problem: I can find a window but when I send a key nothing happens:

#include <MsgBoxConstants.au3>

$title = "SR2ShipGenerator";

Func Main()
   Local $hWnd = WinGetHandle("Rangers")
   If @error Then
      MsgBox($MB_SYSTEMMODAL, $title, "An error occurred when trying to retrieve the window handle of Space Rangers")
      MsgBox($MB_SYSTEMMODAL, $title, "Space Rangers window found with ID = " & $hWnd)

   ControlSend($hWnd, "", "", '{ESC}')

It seems that I'm wrong with ControlSend part and I should specify some control inside a window, but I don't know its internal structure. Spy++ shows me following:


But I can't see internal structure of window (buttons/etc). Thus I cannot debug/analyze what's wrong with my script.

Any suggestions? How can I fix this problem? I appreciate any help.

Share this post

Link to post
Share on other sites


Welcome to the AutoIt forum. :)

Unfortunately you appear to have missed the Forum rules on your way in. (there is also a link in my signature) 
Please read them now particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked. :naughty:

See you soon with a legitimate question I hope. :)


SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource        Forum Rules
Live for the present,
Dream of the future,
Learn from the past.

Share this post

Link to post
Share on other sites
This topic is now closed to further replies.

  • Create New...