Solved

Get window handle

Posted on 1998-10-15
11
289 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 

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

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
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…
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 brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…

717 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