Could somebody give me the name of a couple functions I could use to find the top level window handle based on what EXE the window was run from?
Posted on 2001-12-05 22:00:26 by matthew
I hope i understand your question

The 'GetForegroundWindow' function returns the handle of the foreground window (the window with which the user is currently working).

The return value is the handle of the foreground window.
Posted on 2001-12-06 01:39:37 by CRYO
FindWindow() can be used to get the top-level window, if u know the "class" name. pass NULL in the second parameter.

Also check out the WindowFromPoint() function.

GetWindow() can be used to get the handles of windows inside the top-level window

goto
Posted on 2001-12-06 07:48:45 by goto
Sorry I worded that funny..

I'll give an example because i cannot really word it properly...

Id est.. (Ie. latin :))

I can use findwindow to find the windows handle based on window title or class. But what if the class is one used commonly by windows, and the title changes all the time.

So if I could see if a certain exe was loaded into memory, then find the handle to its top level window it would guarantee i found the right program.

Just another example thing i want to code, cant close icq because it is ever changing..

Thanks,
Posted on 2001-12-06 21:30:23 by matthew