Use RoboScripter Output When Window Name is Too Generic

Started by mcjathan, February 12, 2016, 03:45:07 PM

Previous topic - Next topic

mcjathan

Greetings,  Please consider this RoboScripter output:

Quote
;RoboScripter
; Made with
;   RoboScripter ver: 45
;   CtlMgr ver: 44039
AddExtender("wwctl44i.dll")

;Title: WinFax PRO
;ID: 0
;Class: #32770
;Level: 1

; Default cWndByWndSpec seems OK here
ControlHandle=cWndByWndSpec("#32770","csrss",2,2,65535)
; ControlHandle=cWndByWndSpecName("WinFax PRO","csrss",2,2,65535)
; ControlHandle=DllHwnd('WinFax PRO')
WinWaitExist("WinFax PRO", -1 )  ;Wait for window to exist ;TODO Check title and timeout value

I want to be able to detect and then close the window.  However, the "WinFax PRO" window name is too generic in my case -- I detect too many irrelevant windows.  So, is there a way I can convert the ControlHandle to a variable that can be used in the function WinWaitExist?  Something like this?

Quote
ControlHandle=cWndByWndSpec("#32770","csrss",2,2,65535)
Win1 = SomeWinbatchFunction(ControlHandle)
WinWaitExist(Win1, -1)

td

See cWinIdConvert in the Consolidated WIL Help file.  Most  functions that take window names will also take window Ids.  The function converts a window handle to a window id.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade