how do i find out the class of an application so that i can use the function findwindow, to get its handle?
Printable View
how do i find out the class of an application so that i can use the function findwindow, to get its handle?
The class name is normally registred when the window is created.
The only way that I know of to get the class name is to call GetClassName. But that call requires the hWnd of the window. So I suppose that is of no help to you.
how come megatron knew that ie was "IEFRAME" then?
OK I thought you wanted to know how your program could find out.
You can use SPY++ to get the Class name.
There's many way to find out, but the thing is that you find the window handles, not the classes.
Enumwindows, enumerates windows
Windowfrompoint, returns the top window from a position on the screen.
getparent, returns the parent window to a window.
you could do a lot with that already. well, never used spy++ since i made my own
I don't use Spy++ either, I made my own spy tool which can get almost any information about windows (which it stores in a treeview), the only problem I have with the program is the fact that I can't subclass other threads without a DLL.
About your question: You can enumerate the windows using EnumWindows and in the EnumProc check the classname of the window you want.
well then how do i find out the class through spy++?
also, i do want the class names, so that i can find a window of ie, or word, and make it faster than if i had to enumerate all windows!
Start Spy++ and choose the Find Window tool on the Spy menu.
Drag the Finder Tool to the window you want to find the class for and drop it.
Word 2000 => OpusApp
Best regards
thanks Joacim