473,807 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 = "ComboBoxEx 32"

'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 1784
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.co mwrote in message
news:24******** *************** *******@earthli nk.com...
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 = "ComboBoxEx 32"

'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.co mwrote in message
news:hO******** *************** *******@earthli nk.com...
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
2235
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
21196
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 with the highest value, and then if there was more than one row for that ID with the same value in F1, look at column 3 (F2) and select the row with the highest value in this column. SQL> select * from test;
2
1323
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) } http://www.webfreeguide.com
1
3949
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 this attribute as soon as the page loads......which I don't to happen....I don't want to the context menu visible until the page is done loading, and within the window onLoad event I have a vbscript subroutine that connects to a database to pull...
6
2314
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? The compiler i'm using is Dev c++. #include <stdio.h> #include <stdlib.h>
3
8466
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 same code doesn't work for Bound, see below: Any one of these work for a non-bound listbox. Code:
1
6355
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 the attributes. If I have some XML: <ApplicationConfiguration Test="Blahblah" AnotherAttr="asdfasd">
1
1055
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 but it doesn't work. How would you help me on my problem. Tahnx.
8
2580
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 together making a form. But somthing strange goes on: the form will only pass it's fields forward under method GET, but not on POST. Here's a snippet of code, just the basics: print "<form name=\"postcomment\" action=\"".HTTP_ROOT."/pages/
0
9599
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10626
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10112
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7650
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6879
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5685
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3854
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.