MulgraveTester
15 years agoFrequent Contributor
Findchild whose WndStyles property has a specified element
I want to identify popup dialogs that may appear as my script navigates my application. All the dialogs have WndStyles property with WS_POPUP set. If I anticipate a dialog I wait until my application has an additional child then go looking for it. How do I use the FindChild method to search for an element of WndStyles?
'VBScript psuedo-code
appChildren = aliases.myApp.ChildCount
'Do soething suspect - like save a record
if aliases.myApp.WaitProperty("ChildCount", appChildren +1, 1000) 'wait up to one second to see if a dialog appeared
'A new child was found so get a handle on the dialog
set dialog = aliases.myApp.FindChild(???????) 'find the object whose (WndStyles AND WS_POPUP) = WS_POPUP
end if
Is it at all possible to apply a mask like WS_POPUP to a WndStyles property search using FindChild?
'VBScript psuedo-code
appChildren = aliases.myApp.ChildCount
'Do soething suspect - like save a record
if aliases.myApp.WaitProperty("ChildCount", appChildren +1, 1000) 'wait up to one second to see if a dialog appeared
'A new child was found so get a handle on the dialog
set dialog = aliases.myApp.FindChild(???????) 'find the object whose (WndStyles AND WS_POPUP) = WS_POPUP
end if
Is it at all possible to apply a mask like WS_POPUP to a WndStyles property search using FindChild?