ApplicationGetNext()

Class library usage, coding and language questions.
tkondal
Posts: 24
Joined: Fri Nov 03, 2006 5:50 pm

ApplicationGetNext()

Post by tkondal » Fri Mar 30, 2007 4:44 pm

Hi,

I am trying to use the ApplicationGetNext() function but keep on getting incorrect argument errors. I am passing it a valid handle as a parameter:

Code: Select all

hWnd = RanorexPython.ApplicationGetFirst();
RanorexPython.ApplicationGetNext(hWnd);
What is the correct parameter list, and could you please update this in the documentation file as well?

Btw, is there a tool that I can use in the future to detect the proper function arguments, something like a DLL viewer for the exports; I tried PE Explorer, but it isn't able to get the function argument list.

Thanks.

admin
Site Admin
Site Admin
Posts: 350
Joined: Wed Jul 05, 2006 7:44 pm

Post by admin » Sun Apr 01, 2007 9:20 pm

We found and fixed a bug in the ApplicationGetNext() function last week.
We will release this fix in the next version.

But you can do the same with the FormGetFirstChild and FormGetNextChild functions.
If you use the functions with handle = 0, then you can enumerate the top level windows.

Code: Select all

form = Ranorex.FormGetFirstChild(0)
while form > 0:
    print Ranorex.ControlGetText(form)
    form = Ranorex.FormGetNextChild(0, form)
is the same as

Code: Select all

form = Ranorex.ApplicationGetFirst()
while form > 0:
    print Ranorex.ControlGetText(form)
    form = Ranorex.ApplicationGetNext(form)

Jenö
Ranorex Team