Get window handle

Is there a way to get the handle for eg. the Netscape window. FindWindow won't work here, since I don't know what the title of the window would be (netscape inserts the title of the page in the title)
carceriAsked:
Who is Participating?
 
jusdesConnect With a Mentor Commented:
Hey bro this is the code that finds the window to Netscape:
a% = FindWindow("Afx:400000:b:14fe:6:5787", vbNullString)

I didn't want to find all the buttons and everything but if you need me to I will o and for an example here's the ones for msie:

a% = FindWindow("IEFRAME", vbNullString)
b% = FindChildByClass(a%, "Worker")
c% = FindChildByClass(b%, "ReBarWindow32")
d% = FindChildByClass(c%, "SysPager")
E% = FindChildByClass(d%, "ToolbarWindow32")
F% = FindChildByClass(c%, "ComboBoxEx32")
g% = FindChildByClass(F%, "ComboBox")
H% = FindChildByClass(g%, "Edit")

hope that helps and i'd like to answer my first question ;)


0
 
jkrCommented:
You could use the window's class name in the call to 'FindWindow()' instead. It can easily be found out by using any message spying tool (Sorry, can't tell you the actual class name, using IE ;-).
0
 
carceriAuthor Commented:
Thanks, I'll try to see if that works (although I can't check it right now... using UNIX :-)
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
carceriAuthor Commented:
Also thanks to you jkr !
0
 
carceriAuthor Commented:
I just want to notify other people using this code, that Afx:400000:b:14fe:6:5787 isn't always the class name of Netscape. The last four digits are never the same.
0
 
jkrCommented:
Of course not - it depeds on the version, that's why i told you to use a spy application to find out the class name...
0
 
carceriAuthor Commented:
Well, I am using the same version, but every time I start it up, I get a different class name. Not that it's a problem... I have found a way to work around this.

0
 
jkrCommented:
Of course not - it depeds on the version, that's why i told you to use a spy application to find out the class name...
0
 
carceriAuthor Commented:
I am using a spy app to find it, but when I make the program I can't ask the users to launch their spy app and type in the class name :-)
0
 
jusdesCommented:
you should create a spy app then and keep it hidden and use it to find the window ;) heh
they not that hard to make
0
 
carceriAuthor Commented:
Hehe... that was sort of what I did !!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.