How do I get the parent form of a #32770 form?

Ask general questions here.
User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

How do I get the parent form of a #32770 form?

Post by Aracknid » Thu Jul 14, 2011 10:30 pm

In my older automation app, I was using a Windows API command 'GetParent', passing in the handle of the #32770 window, getting back the handle of the parent window. So usually this was the IE window in my testing.

Is there a way using Ranorex API to get the parent?

If not, I guess I continue to use the Windos API, and if so is there an easy way to do this exposed by Ranorex?

Thanks,

Aracknid

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How do I get the parent form of a #32770 form?

Post by Ciege » Thu Jul 14, 2011 11:14 pm

Do you have a valid Ranorex element?
If so you can use MyElement.Element.Parent to get the parent.
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: How do I get the parent form of a #32770 form?

Post by Aracknid » Thu Jul 14, 2011 11:34 pm

The IE message boxes are shown at the top level of the Spy Tree. Will they have a parent if I use your proposed way?

User avatar
Ciege
Posts: 1336
Joined: Thu Oct 16, 2008 6:46 pm
Location: Arizona, USA

Re: How do I get the parent form of a #32770 form?

Post by Ciege » Thu Jul 14, 2011 11:37 pm

Well, if Spy shows that they have no parent then... No, no method will give you the parent since there is none...
If this or any response has helped you, please reply to the thread stating that it worked so other people with a similar issue will know how you fixed your issue!

Ciege...

User avatar
Aracknid
Posts: 388
Joined: Tue Aug 10, 2010 3:23 pm
Location: Toronto, Ontario, Canada

Re: How do I get the parent form of a #32770 form?

Post by Aracknid » Fri Jul 15, 2011 7:32 pm

I tied to do as you suggested, but it returns the handle of the Host (top of Spy tree).

Instead I added a reference Windows user32.dll and called the function GetParent and it returned the IE Form handle that spawned the #32770 window.

Just as an FYI, I need to know which IE form spawned the #32770 window so I can ensure I'm working with the popup of the IE form I'm testing within instead of another IE form that could be open that popped up its own #32770 window.

Aracknid