?
Solved

Get window handle

Posted on 1998-10-15
11
Medium Priority
?
301 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 210 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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 

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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

This tutorial is about how to put some of your C++ program's functionality into a standard DLL, and how to make working with the EXE and the DLL simple and seamless.   We'll be using Microsoft Visual Studio 2008 and we will cut out the noise; that i…
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 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…
Screencast - Getting to Know the Pipeline

840 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