Hi Arlene,
If you have a chance to get the original problem (not properly disposed of dialogs) solved, then this is definitely the best way to go.
Otherwise, if RefreshMappingInfo works for you, I think that this is OK to use it (at the cost of some performance penalty.
In my case it was 'by design' how developers hide this or that element from been displayed on the screen. So I ended up with search for all required controls (e.g. all buttons that are children of the given form) and then check the values of .Parent.Visible (as well as .Parent.Heigth and .Parent.Width) for several levels up (3 levels usually was enough).