I am still quiet new using TC. so it would be great if anyone with more experience could give me a little advise of how to handle objects of WndClass Afx.
one window in our application contains such an Afx-window and uses it like a simple edit field - at least from my moint of view [img]images/icons/confused.gif[/img] . the Afx-box contains a simple string like "AA BB CC" and I have to read it out. however I could not get it done since I cannot find any property like wText, any method or something like this.
The wText property is added to the controls whose window class is listed in the Object Mapping option (Options... | Engine Options...) for the Edit item. Also, the control should respond to standard Windows messages that TestComplete sends to it to get the displayed text.
Thus, to get the text displayed in your edit box, please add its window class to the Edit item of the Object Mapping option. Note: You should use the constant part of the window class name in the Object Mapping option. The part that can change should be replaced with the * wildcard. (TestComplete uses this notation when recording scripts with windows whose class name begins with Afx)
If this does not help, this will mean that your edit box does not respond properly to Windows messages. In such a case you can solve the problem by compiling your application as Open Application and accessing the control's native properties and methods. If you cannot make use of the Open Application technology, you can try using shortcuts to copy the contents of the edit box to the clipboard. The Sys.Clipboard property will return the clipboard contents.
thanks for your response.
The solutions you suggested are the one's I already have thought of. But I could not get the object mapping procedure working. Mark & copy to clipboard should also not work (at laest I think so), since the box is disabled and therefore I think I will not be able to mark the string... But maybe it is possible to enable the box by script, copy string to clipboard and disable it again. I will check out.
In the meantime I built a script that got screenshots of all such boxes in the application and stores it onto drive. A further script will now compare these screenshots as expected against all displayed boxes in further releases. And this is an absolutely sufficient way...
Nevertheless thanks for your response once more.
You can try using the MSAA plug-in to get the text of the edit field if the control supports the Iaccessible interface: Please add the control's class name to the "Show MSAA objects" option (Options | Engine Options | MSAA) and restart your application.
BTW, why you do not want using the Open Application feature? Most likely, it would solve the problem.