Forum Discussion

MulgraveTester's avatar
MulgraveTester
Frequent Contributor
15 years ago

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?

2 Replies

  • irina_lukina's avatar
    irina_lukina
    Super Contributor

    Hi Michael,


    Try using the following code snippet:



    appChildren = aliases.myApp.ChildCount

    'Do soething suspect - like save a record

    if aliases.myApp.WaitProperty("ChildCount", appChildren +1, 1000) then

        'A new child was found so get a handle on the dialog

        set dialog = aliases.myApp.FindChild("WndStyles", WS_POPUP, 10)

    end if


    Does it help?