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

Pull the current URL address from Internet Explorer

Hi,

I am writing a utility to help me in Internet Explorer.

How do i access Internet Explorer information.

For starters I would like to read the current URL from internet
explorer, into a variable in my programme. How do i do this?

Thankyou

Gary

Nov 28 '06 #1
4 4890
I'm getting somewhere with this.
I have learnt that I need to include Shdocvw.dll into my project. And
then use the following code...

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace InternetExplorerInterface
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
foreach (InternetExplorer ie in new ShellWindows())
{
MessageBox.Show(ie.HWND);
MessageBox.Show(ie.LocationName);
MessageBox.Show(ie.LocationURL);

}

}
}
}
However when i run this my code can't find ShellWindows() - i'm guess
this is because i haven't included it's namespace in my using
directives.. But i'm having trouble finding out which namespace it
belongs to.

Also I do not really understand what a dll is (my limited understanding
before was that it was a driver file for a device) but that isn't
sufficing now as i'm getting into programming.

Can someone clarify this for me please? And also suggest why my code
isn't compiling.

TIA

Nov 28 '06 #2
This is a slow day for the group today! Not many replies. I guess the
learned programmers must be involved in their own projects!

Not to worry about this thread anymore, after much investigation i've
solved it!

Nov 28 '06 #3
Gald you have solved it, I was going to suggest you take a look at
http://www.pinvoke.net, as it has the windows API's fairly well covered and
might have been of use to you.

Keep it for future reference :)

--
--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
<ga********@myway.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
This is a slow day for the group today! Not many replies. I guess the
learned programmers must be involved in their own projects!

Not to worry about this thread anymore, after much investigation i've
solved it!

Nov 28 '06 #4
here is an example, you will need to add references to Microsoft.mshtml (ActiveX) and SHdocVw

SHDocVw.ShellWindows SWs = new SHDocVw.ShellWindows();

object Doc;

foreach (SHDocVw.InternetExplorer IE in SWs)

{

Doc = IE.Document;

if (Doc.GetType().FullName == "mshtml.HTMLDocumentClass")

{

mshtml.HTMLDocumentClass oHTML = (mshtml.HTMLDocumentClass)Doc;

if (oHTML.title != "")

{

}

}

}

<ga********@myway.comwrote in message news:11**********************@l12g2000cwl.googlegr oups.com...
This is a slow day for the group today! Not many replies. I guess the
learned programmers must be involved in their own projects!

Not to worry about this thread anymore, after much investigation i've
solved it!
Nov 28 '06 #5

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

Similar topics

0
by: Matt | last post by:
Hello everyone, I have a program that creates a button on the toolbar in Internet Explorer when installed. My question is this: When I launch this program from an open Internet Explorer window,...
1
by: Nick J | last post by:
Hi, I have a command button, when I press it I would like it to find the record I have specified in a text box on the current form and to pull fields such as Address 1 and Address 2 from another...
3
by: Dan Neely | last post by:
I'm creating a copy of IE using System.Diagnostics.Process and I can pass it any URL at startup, but can't find a way to check what page is open, or to send a new page. I'm implementing this for...
3
by: ewhite2142 | last post by:
I am writing code in VB.Net to access data from the Internet. If I write the following code, I get access to a new instance of Internet Explorer: Imports SHDocVw Dim Br as New InternetExplorer...
3
by: VK | last post by:
Internet Explorer 7 beta 2 preview CNET Editor review: <http://reviews.cnet.com/Internet_Explorer_7_for_XP_SP2_Beta_2/4505-3514_7-31454661-2.html?tag=nl.e415> Summary (my personal review...
1
by: roveagh1 | last post by:
Hi I've been using the 2 year old link below to repeat values from previous record field into current corresponding field. It's worked fine for text but the last piece of advice was to use the same...
1
by: abhinav2104 | last post by:
I am a novice user and would like to know if is it possible to set the "Address" field of the Internet Explorer through C#(only C#, no other language). I want to open Internet Explorer on the press...
5
by: sujit1779 | last post by:
Hi, How can i get the address opened by a user in his internet explorer or any other browser. For eg if a user has opened site www.yahoo.com then, how can I get that programatically thanks
5
by: davidson1 | last post by:
Hai friends.... i am using internet explorer...there are so many url are stored in address bar in internet explorer....how to remove it...can u help me... Thanks in advance......
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.