Get the current URL from IE (or any other browser)
Get the current URL from IE (or any other browser)
Hello, I'd like to know a way to get the current URL for IE or any other browser? I'd like to get all of the URLs if their are multiple instances. Is this possible using PB?
-
PolyVector
- Enthusiast

- Posts: 499
- Joined: Wed Sep 17, 2003 9:17 pm
- Location: Southern California
- Contact:
I think you can use GetGadgetText(GadgetNumber)....
But you can always try this way too
But you can always try this way too
Code: Select all
Procedure.s ByteStr(pointer.l)
strlen.w = WideCharToMultiByte_(#CP_ACP, 0, pointer, -1, 0, 0 , 0, 0)
string.s = Space(strlen)
If strlen <> 0
newlen.w = WideCharToMultiByte_(#CP_ACP, 0, pointer, -1, @string, strlen , 0, 0)
EndIf
SysFreeString_(pointer) ; <<---- free the string.
ProcedureReturn string
EndProcedure
Procedure.s GetLocationName$(WebGadgetNumber.l)
Protected WebObject.IWebBrowser2,Ptr.l
WebObject = GetWindowLong_(GadgetID(WebGadgetNumber), #GWL_USERDATA)
WebObject\get_LocationName(@Ptr.l)
ProcedureReturn ByteStr(Ptr)
EndProcedure
Procedure.s GetLocationURL$(WebGadgetNumber.l)
Protected WebObject.IWebBrowser2,Ptr.l
WebObject = GetWindowLong_(GadgetID(WebGadgetNumber), #GWL_USERDATA)
WebObject\get_LocationURL(@Ptr.l)
ProcedureReturn ByteStr(Ptr)
EndProcedureRe: Get the current URL from IE (or any other browser)
> I'd like to know a way to get the current URL for IE
Justin's answer here works for me with IE:
viewtopic.php?t=4478
(BTW, please use the Search function here... I found the link above
simply by searching for "Internet Explorer").
Justin's answer here works for me with IE:
viewtopic.php?t=4478
(BTW, please use the Search function here... I found the link above
simply by searching for "Internet Explorer").

