Page 1 of 1

Support of work with non-standard controls using Win32 API

Posted: Fri Mar 04, 2011 2:59 pm
by AKalytiuk
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

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

Posted: Fri Mar 04, 2011 4:00 pm
by Ciege
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?

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

Posted: Fri Mar 04, 2011 11:27 pm
by Support Team
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

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

Posted: Fri Mar 11, 2011 5:14 pm
by AKalytiuk
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

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

Posted: Fri Mar 11, 2011 5:46 pm
by Ciege
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.

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

Posted: Fri Mar 11, 2011 7:07 pm
by sdaly
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.