Solved

Get window handle

Posted on 1998-10-15
11
288 Views
Last Modified: 2013-12-03
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)
0
Comment
Question by:carceri
  • 6
  • 3
  • 2
11 Comments
 
LVL 86

Expert Comment

by:jkr
ID: 1415285
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
 

Accepted Solution

by:
jusdes earned 70 total points
ID: 1415286
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
 

Author Comment

by:carceri
ID: 1415287
Thanks, I'll try to see if that works (although I can't check it right now... using UNIX :-)
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:carceri
ID: 1415288
Also thanks to you jkr !
0
 

Author Comment

by:carceri
ID: 1415289
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
 
LVL 86

Expert Comment

by:jkr
ID: 1415290
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
 

Author Comment

by:carceri
ID: 1415291
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
 
LVL 86

Expert Comment

by:jkr
ID: 1415292
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
 

Author Comment

by:carceri
ID: 1415293
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
 

Expert Comment

by:jusdes
ID: 1415294
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
 

Author Comment

by:carceri
ID: 1415295
Hehe... that was sort of what I did !!
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question