473,413 Members | 1,789 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,413 software developers and data experts.

Finding the URL being viewed in IE from a PID or hWnd

Hi
I'm trying to find the URL that is being viewed in an IE window, by using
the PID or the hWnd of the IE window.

Does anyone know how this could be done? or where I should be looking?

Thanks
Mar 12 '06 #1
2 2005
Hi,

This will require interop to the windows API.

Once you have the hwnd of internet explorer you can use the EnumChildWindows
to locate the combobox, for IE 6 the class name is ComboBoxEx32 and the
control id is 0xA205. The caption of the control is the URL in the address
bar.

Hope this helps

--
Chris Taylor
http://dotnetjunkies.com/weblog/chris.taylor
"Paul Aspinall" <pa**@aspy.co.uk> wrote in message
news:vS*********************@fe2.news.blueyonder.c o.uk...
Hi
I'm trying to find the URL that is being viewed in an IE window, by using
the PID or the hWnd of the IE window.

Does anyone know how this could be done? or where I should be looking?

Thanks

Mar 12 '06 #2
>I'm trying to find the URL that is being viewed in an IE window, by using
the PID or the hWnd of the IE window.

Does anyone know how this could be done? or where I should be looking?

If you're only interested in IE it may be better to use the COM APIs
in Shdocvw.dll. If you Tlbimp it you can write code like this to dump
info on all IE (and Windows Explorer) windows.
foreach (InternetExplorer ie in new ShellWindows())
{
Console.WriteLine(ie.HWND);
Console.WriteLine(ie.LocationName);
Console.WriteLine(ie.LocationURL);
}
Mattias

--
Mattias Sjögren [C# MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.
Mar 12 '06 #3

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

Similar topics

3
by: Andrew Moore | last post by:
Hi All, I have a managed C++ class that makes calls into the Win32 API. I specifically am trying to take a Handle from a .NET form and convert it to a HWND to pass to a Win32 functions. The...
17
by: Bonj | last post by:
Is PostQuitMessage(?) different to PostMessage(hWnd, WM_QUIT, ... ) ? I've got a window in a DLL (the same one experiencing the issue below, "return value of WM_QUIT") in which PostMessage(hWnd,...
1
by: Jason | last post by:
Hi everyone, there is some text in one of my VB.NET programs (on a form of course) that looks outwright silly if the users system is changed to 120 DPI. (This particular setting is modified if...
4
by: --== Alain ==-- | last post by:
Hi, When i debugged my code (see below) from my overrider WndProc method, i discovered that update has alway left, right, botton and top set to 0. therefore i wonder if my hwnd point to the...
15
by: =?Utf-8?B?Sm9hY2hpbQ==?= | last post by:
How can I pass a C++ HWND to and from C# and Managed C++?
2
by: goldfish999 | last post by:
I am new to Visual Basic (have not used since version 1 !!) but am trying to learn a new language (have had experience with Delphi ). I have an existing database created in VB 2005 of a Master Table...
11
by: =?ISO-8859-15?Q?Kolja_M=E4rtens?= | last post by:
Hello! I've been professionally working on java projects for several years, but have done extremely little C/C++ coding and just a few little things in VB.Net. Right now I'm trying to write a...
0
by: BarryM | last post by:
I was told that this piece coding to find the es_password state in c# would work but an error message saying hWnd does not exist in the current context internal static class UnsafeNativeMethods...
2
MrPickle
by: MrPickle | last post by:
I am trying to get all open windows on windows. I have looked around and seen that I should use EnumWindows and EnumWindowsProc so I whipped up this code to test it but it tells me there's 300-400...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...
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...
0
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...
0
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...

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.