Fosco
Tue Dec 07 23:52:00 CST 2004
"Lucas Tam"
> Is there a way WSH can get a handle on the application so
> that I can sendkeys to the app?
Vbs + active x :
http://www.hiddensoft.com/cgi-bin/countdown.pl?AutoIt/AutoItX.zip
http://www.autoitscript.com/autoit3/files/unstable/autoitx/
or stand alone :
http://www.hiddensoft.com/autoit3/
; Identify the Notepad window that contains the text "this one" and get a handle to it
; Change into the WinTitleMatchMode that supports classnames and handles
AutoItSetOption("WinTitleMatchMode", 4)
; Get the handle of a notepad window that contains "this one"
Run("notepad")
sleep(500)
Send("this one")
Run("notepad")
sleep(500)
Send("other one")
sleep(1500)
$handle = WinGetHandle("classname=Notepad", "this one")
$handle2 = WinGetHandle("classname=Notepad", "other one")
If @error Then
MsgBox(4096, "Error", "Could not find the correct window")
Else
; Send some text directly to this window's edit control
ControlSend("handle=" & $handle, "", "Edit1", "AbCdE")
ControlSend("handle=" & $handle2, "", "Edit1", "EdCbA")
EndIf
Msgbox(0,"","this one " & $handle)
Msgbox(0,"","other one " & $handle2)
ControlGetText ( "title", "text", "classnameNN" )
$var = ControlGetText ( "", "", "Edit1" )
Msgbox(0,"",$var)
;PS:
; send("!^+s{down}{left}{F5}") ;sendkeys >> alt Ctrl shift .....
; same as wsh ... + o -
--
Fosco