David,
>Where/how can I check if it is a "top level" window?
The form property you need to check is ShowWindow, the possible values for it are: 0 - In Screen, 1 - In Top Level Form, and 2 - As Top Level Form, 0 are 1 are valid for modal forms, 2 is not.
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?
"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare
"To die for a religion is easier than to live it absolutely"
Jorge L. Borges