473,387 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

MVPS.Org Read/Set Internet Explorer URL from code (api0051) doesn'twork.

Has IE gotten so complex you can't get the URL from IE? The code at
http://www.mvps.org/access/api/api0051.htm used to work. Now it returns
nothing. Is this due to having the IE/Yahoo/Google/WhateverElse toolbars?

I've determined where it fails...at least for me....on the third If()
statement in function Refresh. Maybe MS has changed the value of
ComboBoxEx32 to some other value?

Is there a way to get the URL from an IE window if you have the hWnd of
it? I've got the class and caption, no URL.

Private Const mconIE_COMBOEx = "ComboBoxEx32"

'this works
If fIsNT() Then
hWndChild = apiFindWindowEx(hWnd, 0, _
conIE_WORKERW, vbNullString)
Else
hWndChild = apiFindWindowEx(hWnd, 0, _
mconIE_WORKERA, vbNullString)
End If

'this works
If hWndChild 0 Then
' Rebar is child of Worker window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_REBAR, vbNullString)
End If

'heres where it fails. It always returns 0
If hWndChild 0 Then
' ComboboxEx is child of Rebar window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_COMBOEx, vbNullString)
End If

'since it's 0 now, it's ignored
If hWndChild 0 Then
' ComboBox is child of ComboBoxEx Window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_COMBO, vbNullString)
End If

'since it's 0 now, it's ignored
If hWndChild 0 Then
' Edit class is child of ComboBox window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_EDIT, vbNullString)
End If
Jun 27 '08 #1
4 1763
Just glancing at your code, your check for validity of hWnd is incorrect.
For NT or higher you follow this logic:

If hWndChild <0 Then

NT or higher you can get a negative value for the hWnd as it is now a full
32 bit value.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Salad" <oi*@vinegar.comwrote in message
news:24******************************@earthlink.co m...
Has IE gotten so complex you can't get the URL from IE? The code at
http://www.mvps.org/access/api/api0051.htm used to work. Now it returns
nothing. Is this due to having the IE/Yahoo/Google/WhateverElse toolbars?

I've determined where it fails...at least for me....on the third If()
statement in function Refresh. Maybe MS has changed the value of
ComboBoxEx32 to some other value?

Is there a way to get the URL from an IE window if you have the hWnd of
it? I've got the class and caption, no URL.

Private Const mconIE_COMBOEx = "ComboBoxEx32"

'this works
If fIsNT() Then
hWndChild = apiFindWindowEx(hWnd, 0, _
conIE_WORKERW, vbNullString)
Else
hWndChild = apiFindWindowEx(hWnd, 0, _
mconIE_WORKERA, vbNullString)
End If

'this works
If hWndChild 0 Then
' Rebar is child of Worker window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_REBAR, vbNullString)
End If

'heres where it fails. It always returns 0
If hWndChild 0 Then
' ComboboxEx is child of Rebar window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_COMBOEx, vbNullString)
End If

'since it's 0 now, it's ignored
If hWndChild 0 Then
' ComboBox is child of ComboBoxEx Window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_COMBO, vbNullString)
End If

'since it's 0 now, it's ignored
If hWndChild 0 Then
' Edit class is child of ComboBox window
hWndChild = apiFindWindowEx(hWndChild, 0, _
mconIE_EDIT, vbNullString)
End If

Jun 28 '08 #2
Stephen Lebans wrote:
Just glancing at your code, your check for validity of hWnd is incorrect.
For NT or higher you follow this logic:

If hWndChild <0 Then

NT or higher you can get a negative value for the hWnd as it is now a full
32 bit value.
Hi Stephen:

The code at http://www.mvps.org/access/api/api0051.htm worked back in
2005. It was part of my app. I noticed recently it no longer worked.

I changed all references of "hWndChild 0" to "hWndChild <0". That
didn't help because in the third if statement in procedure Refresh()
hWndChild gets set to zero.

I'm thinking that perhaps MS has moved on and the code at the site
hasn't been upgraded and perhaps will never work without a major upgrade.

I really would like to enumerate through open IE windows and present the
subject lines/Urls to the user to associate records with a specific URL.

Jun 29 '08 #3
Check the Classnames for your version of Internet Explorer as they have
probably changed in some fashion. Do you have Spy++ on your system? Or there
is a WIndow Class viewer on the Access MVP site.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Salad" <oi*@vinegar.comwrote in message
news:hO******************************@earthlink.co m...
Stephen Lebans wrote:
>Just glancing at your code, your check for validity of hWnd is incorrect.
For NT or higher you follow this logic:

If hWndChild <0 Then

NT or higher you can get a negative value for the hWnd as it is now a
full 32 bit value.

Hi Stephen:

The code at http://www.mvps.org/access/api/api0051.htm worked back in
2005. It was part of my app. I noticed recently it no longer worked.

I changed all references of "hWndChild 0" to "hWndChild <0". That
didn't help because in the third if statement in procedure Refresh()
hWndChild gets set to zero.

I'm thinking that perhaps MS has moved on and the code at the site hasn't
been upgraded and perhaps will never work without a major upgrade.

I really would like to enumerate through open IE windows and present the
subject lines/Urls to the user to associate records with a specific URL.

Jun 29 '08 #4
Stephen Lebans wrote:
Check the Classnames for your version of Internet Explorer as they have
probably changed in some fashion. Do you have Spy++ on your system? Or there
is a WIndow Class viewer on the Access MVP site.
Hi Stephen:

The code in produre "Refresh() enumerates all open windows and
determines the hWnd number and the caption of each window. It then gets
the class of each window. If the class is "IEFrame", IE's class name,
it then attempts to extract the URL. Up to this point it processes
correctly.

After getting the class and caption the first two If/Endif's work fine
as well.

It is the 3rd-5th If/Endifs that fail when getting the hWndChild
values...;child of Rebar window, child of ComboBoxEx, and child of
ComboBox window. Since the Url locater is a combo box I figure that's
why they last 3 calls to get the hWndChild are looking for a combobox type.
Jun 30 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Polite | last post by:
I need to put recursive data structures on disc and found out that cPickle doesn't like recursion. What are my options? alex -- Alex Polite http://polite.se
2
by: sukh | last post by:
From the table i want everything highlighted with a * I wanted an SQl expression to look at values in Column 1 (ID), look at the corresponding values in the second column (F1) and select the row...
2
by: Amir | last post by:
I used FireFox Jscript debuging capabilities but it says: frm variable doesn't have the property Action function submitForm(frm,action){ frm.action=action; frm.submit(); return(false) }...
1
by: ItsMillerTime4u | last post by:
I'm trying to change the <body> 's event oncontextmenu attributes, but am having no luck at it. I know I can do <body oncontextmenu="contextMenu(); return false;"> but the thing is that I set's...
6
by: dddddddd2444444 | last post by:
Hi,please help... It works fine when I define a 2-D array like char code. But it won't work when I try to define the array dynamically using a function. It just crashes. Does anyone know why?...
3
by: Richard Albrecht | last post by:
I have been trying to figure out for days on how to read values from a Bound ListBox. The listBox gets the values from an Access Table. I can read values fine for Non-Bound ListBoxes, But the...
1
by: Keith Patrick | last post by:
I'm converting over from using XmlNodes (specifically ConfigXmlNode, but the API uses XmlNode) to IXPathNavigable in some methods I have, but I'm finding in the process, that I can't seem to get...
1
by: czi02 | last post by:
I having a problem on my properties window because my url doesn;t like tyo preview my gif. I put on my url the location of my gif but it doesn'twork. I type on my url the d:shared\czifiles\iva002.gif...
8
by: bruno_guedesav | last post by:
This has ocurred before, but if the person had find a way to solve it or not, I've got no clue. So, here I am to ask for help. I've created a form via pure PHP, basically a bunch of prints...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.