Click to See Complete Forum and Search --> : How to get window Hwnd without...


udi.p
March 19th, 2000, 11:57 PM
Hello !
How can I get window handle without spy++ and without know his caption?
For example I run Internet Explore from VB program and I want to get his hwnd.
Thanks.

Ravi Kiran
March 20th, 2000, 02:32 AM
You should know something about the window!, to decide if that is the window you need.

There is a EnumWindows Api which will pass all the TOP level windows handles, one by one, to a application defined call back function. So, if you know the window caption, or class name or something about the window, then you can check that property to decide. (There is a sample in articles section of Codeguru/vb. check it out)

If you know the class name then you can also use a FindWindow to get the match. Internet Explorer's class name seems to be "Internet Explorer_Server", got with Spy++


RK

udi.p
March 22nd, 2000, 01:52 AM
Hello Ravi !
First of all thanks about help.
What I know about the window is the "task ID" (from Shell function) but I don't know what to with it.
Do you can help me?