Jump to content

Cannot find Control ID & ControlSend not working without


Recommended Posts

I managed to get ControlSend working in an application without Control ID. However, I was not able to do the same with another application which uses DirectX.

So...

1) How can I do it without?

or

2) How can I dig the Control ID out of the application?

Here is the code that works with first application (almost directly copied from one of the example scripts in ControlSend function description).

; Press n to type d.

Opt("WinTitleMatchMode", 2) ;1=start, 2=subStr, 3=exact, 4=advanced, -1 to -4=Nocase

HotKeySet("n", "DeeDee")
HotKeySet("{ESC}", "Terminate")
HotKeySet("+!d", "ShowMessage")  ;Shift-Alt-d

$handle = WinGetHandle("Application") ;I used this code in the other application but there I used different name "Application2".

;;;; Body of program would go here ;;;;
While 1
    Sleep(100)
WEnd

Func DeeDee()
    ControlSend ($handle, "", "", "{d}")
EndFunc

Func Terminate()
    Exit 0
EndFunc

Func ShowMessage()
    MsgBox(4096,"","This is a message.")
EndFunc
Edited by Templarion
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...