Jump to content
Sign in to follow this  
sajgon

External controls.

Recommended Posts

Can someone write me simple example of script which will press button on external program. Let it be(external program) test.exe which title is testwindow and it have 1 button called buttonA and 1 radio called radioA. What will be the script which will select radioA and then press ButtonA? Thx.

Share this post


Link to post
Share on other sites

Can someone write me simple example of script which will press button on external program. Let it be(external program) test.exe which title is testwindow and it have 1 button called buttonA and 1 radio called radioA. What will be the script which will select radioA and then press ButtonA? Thx.

Try this but am not shure about our question

#include <GUIConstants.au3>

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 633, 447, 193, 125)
$Radio1 = GUICtrlCreateRadio("Radio1", 88, 56, 97, 65)
$Button1 = GUICtrlCreateButton("Button1", 96, 160, 169, 153, 0)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    If ProcessExists ( "test.exe" ) Then
    GUICtrlSetState ( $Radio1, $GUI_CHECKED )
    MsgBox (0, "Info", "process detected") ; the process action on detection
    EndIf
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Radio1
            
        Case $Button1
            MsgBox (0, "Info", "process detected") ;The same action than the detection
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

FreeSiker My problem is that i want to interract with external GUI which wasnt made by me. I need to press buttons end edit checkbox states on this external GUI with some hotkeys. I know how to do this with sending my mouse over it or with sending LEFT, RIGHT, TAB and ENTER buttons but its not satisfaying me:P

I used tool called "AutoIt Window Info Tool" and get some informations about the keys but have no ide what to do with this xD One of the controls give me this:

Control

Class: WindowsForms10.BUTTON.app.0.378734a

Instance: 8

ClassnameNN: WindowsForms10.BUTTON.app.0.378734a8

ID: 721490

Text: 800x600

Position: 18, 63

Size: 82, 26

ControlClick Coords: 28, 9

Style: 0x5601000B

ExStyle: 0x00000000

Handle: 0x000B0252

Window

Title: WinMode Controller

Class: WindowsForms10.window.8.app.0.378734a

Position: 945, 94

Size: 316, 195

Style: 0x16CA0000

ExStyle: 0x00010101

Handle: 0x00040248

Is it possible to make a hotkey which will simulate checking this radio? How shoul i fill ControlCommand() and ControlClick() args whit informations gained with this tool?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...