Solved

Get window handle

Posted on 1998-10-15
11
285 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
 

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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
What my article will show is if you ever had to do processing to a listbox without being able to just select all the items in it. My software Visual Studio 2008 crystal report v11 My issue was I wanted to add crystal report to a form and show…
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…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now