Hook Windows IE address bar

General Macro Scheduler discussion

Moderators: Dorian (MJT support), JRL

Post Reply
User avatar
PepsiHog
Automation Wizard
Posts: 512
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Hook Windows IE address bar

Post by PepsiHog » Mon Oct 11, 2010 1:46 pm

v12

Does anyone have a srt that will hook and retrieve the address bar content of Windows Internet Explorer?

I realize you can automate this and press some FKey and copy it. But in this case that doesn't fit the bill.

If someone has this, I sure would appreciate the help.

Thanls.
Last edited by PepsiHog on Mon Oct 11, 2010 11:42 pm, edited 1 time in total.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

olllllliii
Pro Scripter
Posts: 60
Joined: Tue Dec 22, 2009 9:51 am
Location: Mannheim ( Germany )
Contact:

Did this Help you ?

Post by olllllliii » Mon Oct 11, 2010 3:06 pm

Let>i=1
Label>forward
RegistryReadKey>HKEY_CURRENT_USER,Software\Microsoft\Internet Explorer\TypedURLs,url%i%,urlOUT
IF>urlOUT=
ReadFile>C:\url.txt,info
MessageModal>%info%
EXIT
ELSE
Add>i,1
Let>WLN_NOCRLF=0
WriteLn>C:\url.txt,nWLNRes,urlOUT
Goto>forward
ENDIF
Oliver Hilger Mannheim
alias Olllllliii

User avatar
PepsiHog
Automation Wizard
Posts: 512
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Post by PepsiHog » Mon Oct 11, 2010 11:41 pm

Thanks Oliver.

But I don't need typed URL's. I need what ever is in the address bar.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Tue Oct 12, 2010 9:14 am

This should work across all versions of Windows:

Code: Select all

Press ALT
Send>d
Release ALT
Press CTRL
Send>c
Release CTRL
GetClipBoard>address
MessageModal>address
Obviously requires that Windows Explorer has the focus first.

Not sure if there's a way to do it without sending keystrokes. Actually I can see that there is in Win7 since the address text is exposed and prefixed with "Address ". So we could walk the objects and get the text, or just use GetWindowText and RegEx, something like:

Code: Select all

//assuming Windows Explorer is current window, get it's handle 
Let>WIN_USEHANDLE=1
GetActiveWindow>wHandle,x,y

//get all the window text
GetWindowText>wHandle,allText

//address bar text begins "Address: "
StringReplace>allText,CRLF,||,allText
RegEx>(?<=Address: ).+?(?=\||),allText,0,matches,nm,0
MessageModal>matches_1
But that won't work in XP since the text is not exposed.

I did wonder if there's a way to use DDE like there is with Internet Explorer but I can't find anything about that.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

User avatar
PepsiHog
Automation Wizard
Posts: 512
Joined: Wed Apr 08, 2009 4:19 pm
Location: Florida

Post by PepsiHog » Tue Oct 12, 2010 11:43 pm

v12

Yeah, I don't think I'm going to get what I want this time. I've been searching for a VBS example online (til my eye's exploded),
but no such luck.

Marcus, I've seen this request from others. Do you think a hook command may lie in the future? Maybe....near future?

If someone comes across, or has a vbs script for this purpose, please post
it here. I will keep the "Notify me" option on. Post it for me and all the
others that may be interested. Please.
Windows 7

PepsiHog. Yep! I drink LOTS of Pepsi (still..in 2024) AND enjoy programming. (That's my little piece of heaven!)

The immensity of the scope of possibilities within Macro Scheduler pushes the user beyond just macros!

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts