views:

28

answers:

1

Hi,

I am still trying to test my WinForm application, however some of the testing tools don't work because the custom dialog forms I dynamically create are not child windows in the window tree (in Win32 api sense). I am using Spy++ to browse and search for windows. If I use the Finder Tool on these forms, some of them are found as direct children of the Desktop window (completely outside of my main window hierarchy). How can I make sure they are all in one tree?

EDIT: obviously all windows can be found, I just have to refresh the display in Spy++ all the time.

+1  A: 

A regular (non-MDI child) form is by definition a top-level window that has the desktop as it's parent. So they will never be considered child windows (in the Win32 API sense), unless you explicitly use SetParent to change it (but then you probably shouldn't use a Form to begin with).

Why does this relation matter to your testing tools?

Mattias S