I guess you and me thought in different directions, what I meant is pretty easy to implement (at least in my delphi language, whats yours?), a simple listbox where all current running processes are listed, like TaskMgr.exe does but simplified to .exe name. I hope this was more understandable.
And the current editbox where i can enter "ClassName" would just get a new label like ".exe Name"
There no need to do "where is mouse / under what control / wich handle etc etc etc" action.
I guess we do differ programm such things at all.
My way would be that:
(just as a suggestion)collect all running processes
enumerate all handles and compare them with processes (this way a few hundret handles are sieved and only the good ones remain)
at that point i would have valid handle for mainthread, classname for mainthread and pid collected.
with all three informations together, there is everything possible you need, like window-title, child windows, process-memory and and and =)
with the pid i would realize minimize/send close message command
If you need, I could show you as Delphi code by just using WinApi (what should be valid to all languages)
Since that said, it awoke my interest and i start code a small demo :-)
Code would contain function like "HandleToPID" and "PIDToHandle" stuff, that way all can be easy converted for proper usage like MSDN suggest.
You already done a cool job, I just can repeat myself
And if I sound rough pardon me, take this just as a suggestion not as a "do like i say"