OK, how do I find if an executable is running, and get it's top level window handle?
There are a number of APIs that will list which executables are running. The Toolhelp32 functions Process32First/Next among others would do that. You get the process id from them, then use the same method used in EnumWindows, that is, with the process id open the process, get the full image name (Process32First returns an abbreviated image name - no path information - which is not enough to uniquely identify an executable.)
That step gives you the process id and the full image name.
Once you have that, you can use EnumWindows to enumerate the top level windows. Once you hit the window that has the same process id then you've got the process and window you are interested in.
For good measure, it must be noted that it is possible for the process you found in the first step to end, a new process be created by the user or Windows that just happens to use the same process id as the process that ended. This can happen because Windows re-uses process ids but, because of how Windows goes about re-using process ids, it is extremely unlikely to happen unless you purposely create a contrived case that would cause that situation. I mention it only for completeness. If I were you, I wouldn't worry about it.
HTH.