Support of work with non-standard controls using Win32 API

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
AKalytiuk
Posts: 9
Joined: Fri Mar 04, 2011 2:36 pm
Location: Kyiv, Ukraine

Support of work with non-standard controls using Win32 API

Post by AKalytiuk » Fri Mar 04, 2011 2:59 pm

Hi,

Could you please tell whether Ranorex framework allows work with non-standard controls (not supported out-of the box and created by 3rd party vendors) using Win32 API?

I.E. is there a way to get HWND identifier of complex control that is un-supported and cannot be handled by framework - and then get HWND identifiers and other attributes (kind of description) of child objects from that control? Also please tell is there out-of-the-box means in Ranorex framework for sending Win32 messages to child elements of non-supported controls using previously retrieven HWND identifiers of elements?

(At the moment I want to automate Rouge Wave Stingray Studio controls and DevExpress controls for Visual Studio)

Could you please provide details about classes and methods that allow work with controls using Win32 API layer?

Thanks

Kind regards
Andrii Kalytiiuk

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

Re: Support of work with non-standard controls using Win32 API

Post by Ciege » Fri Mar 04, 2011 4:00 pm

I'm not sure about the Stingray controls but we use DevExpress in our AUT and Ranorex does a great job of identifying the elements.
Have you tried using the free trial (full featured) version of Ranorex to get a feel for what Ranorex can and cannot see in your AUT?
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
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Support of work with non-standard controls using Win32 API

Post by Support Team » Fri Mar 04, 2011 11:27 pm

Yes, please have a look at your controls using the Spy.
Also, with Ranorex 3.0 in the Spy right click on the tree entry corresponding to your application and in the context menu choose "Add Process Name to GDI Capture List". This will enable the rawtext plugin, which intercepts the Win32 low level text output.

Regards,
Roland
Ranorex Support Team

AKalytiuk
Posts: 9
Joined: Fri Mar 04, 2011 2:36 pm
Location: Kyiv, Ukraine

Re: Support of work with non-standard controls using Win32 API

Post by AKalytiuk » Fri Mar 11, 2011 5:14 pm

DevExpress controls are handled properly by Ranorex in our application - thanks very much.

Looks like spy recognize controls (Stingray controls) as 'AfxWndXXXXX' or 'AfxXXXXX' (where XXXXX is some hex-based number). Actually Stingray controls does not implement MSAA interface and the only way to work with them as we see - is direct communicating on Win32 layer (sending messages and identifying controls by internal Id or HWND - Test Complete provides some tools for work with controls on Win32 layer) - my question is whether Ranorex framework provides some out-of-the-box functionality to simplify work with controls using Win32 functions?

Another way for handling unsupported controls is requesting implementation of MSAA for conrols from developement side (actually it is performed gradually - and main challange with it is massive organizational involvement).

Please tell, whether it is planned to include to Ranorex framework some functionality to help work with controls using Win32 API (like inquiring HWND from control's adapter or sending Win32 message to some control and for example inquiring details about all child controls on form)?

Thanks.

Regards
Andrii Kalytiiuk

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

Re: Support of work with non-standard controls using Win32 API

Post by Ciege » Fri Mar 11, 2011 5:46 pm

Hmmm, you can try importing the user32.dll into your code and use GetForegroundWindow (or similar) to get an intptr handle of the window...
http://msdn.microsoft.com/en-us/library ... s.85).aspx

Note, I've not needed to do the above in years and years... Back when I used Rational Robot for my automation I had use for using the Windows DLLs in such ways to get control of forms and windows.
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
sdaly
Posts: 238
Joined: Mon May 10, 2010 11:04 am
Location: Dundee, Scotland

Re: Support of work with non-standard controls using Win32 API

Post by sdaly » Fri Mar 11, 2011 7:07 pm

As already stated, you can use the Ranorex GDI RawText adapters....In V3.0 just select the item in the Spy with the AFX class and right click and add to GDI capture. You may want to add the class name "AFX.*" to the Ranorex config file under the rawtext section as the number after AFX usually changes. Alternatively you could add the process name of your app to the config.

We have had great success using the rawtext plugin with AFX classes and other troublesome controls.