Given a process handle (or process ID) I can enumerate all of the top-level windows (using EnumWindows) and see which ones belong to that process. But how can I determine which one is "the" top-level window. For example, I have an application which has over 30 top-level windows associated with it and I can't always rely on the window title having identifiable text in it. Does anybody know how to solve this problem?

Thanks in advance for your help.