GDI plug-in and pop ups.

Technology specific object identification, supported applications, web technologies, and 3rd party controls.
Posts: 1
Joined: Mon Dec 04, 2017 1:35 pm

GDI plug-in and pop ups.

Post by Remi.Cerise » Mon Dec 04, 2017 2:31 pm


We use Ranorex 5.4.3 for automation on a C++ MFC application with many custom low-level win32 controls. It works pretty well although we have to use the GDI plug-in to parse messages displayed by application pop-ups (unfortunately, we cannot spy them as simply as we want). However, with this (great) tool, we can dynamically load the GDI plug-in each time we know that a process may display pop-ups, then unload it to save time. We have to save time because currently, we use a very general regex when using the RawTextFlavor class. See below (and let's assume "xxx" is the name of our application process).

Code: Select all

RawTextFlavor.Instance.ProcessNames.Add(new Regex("^xxx$"));
Thus, the OCR analysis is applied to the entire application UI and not only the components which really require it.

For a long time now we were fine with this solution, but we recently detect some problems. The major one is that, for some reasons, confusing OCR parsing may happen where a pop-up message and other text (e.g. on graphic figures) that appear in the UI behind are merged in a single result string. This is a problem because the message analysis is then disturbed, causing a wrong pop-up identification at the end.

We were trying to figure how we can improve the code above in order to apply OCR only on pop-up items. We know we can replace ProcessNames.Add() by ClassNames.Add() but don't find clear examples that explain how to do it. Besides, there could also be some other solutions we don't know yet.

For your information, the pop-up element if Ranorex.Form class.

Also note that one of our target execution platform is an old XP SP2 running on a very specific hardware. We didn't succeed using Ranorex 6 or later on it and for this reason, we cannot upgrade the Ranorex version we use beyond 5.4.7.

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: GDI plug-in and pop ups.

Post by odklizec » Tue Dec 05, 2017 1:48 pm


Aside the fact Ranorex 5.4.3 is long time dead (king is dead, long live the king!;)), there is most probably nothing anyone here can do or suggest without seeing the AUT and Ranorex script in question. The problem you are experiencing is simply too unique and description of the problem is not enough to analyze and to suggest something sensible.

I would suggest to contact Ranorex support at [email protected]. But I think the first thing they will tell you is to update Ranorex with latest 7.2.1. Ranorex 5.4.3 is simply too old and no longer supported by Ranorex. So without testing the problem with most recent Ranorex version, doing any investigation in 5.4.3 would be a waste of time and resources. Just my personal opinion ;)
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

User avatar
Posts: 515
Joined: Fri Jul 15, 2016 1:35 pm

Re: GDI plug-in and pop ups.

Post by Stub » Wed Dec 06, 2017 9:18 am

I use GDI capture heavily and also see that RawText element with all the text merged into a single string. Usually, for me at least, there are alternative RawText elements available at the same time that I can use to access the individual portions of a message. This has been sufficient for me to control our C++/MFC application. However, you mention being unable to Spy them which I can imagine makes things tricky to say the least.

However, I started our Ranorex adventure on v6.0 and have since upgraded through all the v6.x.x versions, then skipped ahead to v7.2.0 which I've been very satisfied with. I realise you said later versions don't work for you on your XP SP2 system. FWIW I had inconsistent GDI Capture issues with our application on Win10 until I upgraded to Win10 v1703. Figuring that issue out solved a whole series of utterly showstopping issues for me. Again, I realise this doesn't help you specifically.