Forum Discussion

vthomeschoolmom's avatar
vthomeschoolmom
Super Contributor
13 years ago

windows common dialogs give me a headache

Different versions of the OS have different handles and names for the same controls. This I can code around. But it almost seems as though different runs on the same OS report different windows. Is there a white paper on dealing with windows common controls? The search function of this website does not always return useful hits, and I have been unsuccessful at finding anything. Thanks.

2 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    If you have not done so already, I would read up and devour anything you might be able to find concerning NameMapping, Aliases, and the like.  Specifically, look up and research things like Conditional Mode for NameMapping.



    For example, in a Delphi application I used to work with, in Windows XP, certain forms would show up with a class of "TMessageForm" for certain warning dialogs and such.  In Windows 7, though, this showed up as a class of "#32770".  It was, effectively, the same window, but the OS assigned different classes.  What I did, then, was set up a NameMapping alias for the dialog, looking for the class in a "Conditional Mode" (className = "TMessageForm" or className = "#32770") and defining the form based upon the wndCaption.



    You might want to take a look at this recorded webinar



    http://smartbear.com/support/screencasts/testcomplete/reliable-tests-for-dynamic-objects/