Psilon

Complex window automation with AutoIT

2 posts in this topic

#1 ·  Posted

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";
Main()

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")
      Exit
   Else
      MsgBox($MB_SYSTEMMODAL, $title, "Space Rangers window found with ID = " & $hWnd)
   EndIf

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

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:

sr.png

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



#2 ·  Posted

@Psilon,

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. :)

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


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