
Code : Tout sélectionner
#Win = 0
#Web = 0
If OpenWindow(#Win,0,0,600,300,#PB_Window_SystemMenu|#PB_Window_ScreenCentered,"WebGadget") And CreateGadgetList(WindowID(0))
WebGadget(#Web,10,10,580,280,"http://www.purebasic.com")
; ==================================================================
Browser.IWebBrowser2 = GetWindowLong_(GadgetID(#Web), #GWL_USERDATA)
If Browser = 0
MessageRequester("Erreur","Impossible d'initialiser le navigateur", #MB_OK|#MB_ICONERROR)
End
Else
Repeat
While WindowEvent(): Wend
Delay(1)
Browser\get_Busy(@IsBusy.l)
Until IsBusy = 0
EndIf
Adress.s = Space(#MAX_PATH)
If Browser\get_LocationURL(@Adress) = #ERROR_SUCCESS
MessageRequester("", PeekS(@Adress)) ; Caractères incompréhensibles
EndIf
; ==================================================================
; Note: if you want to use a local file, change last parameter to "file://" + path + filename
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
Je pensais que ça me retournerait l'adresse "http://www.purebasic.com", mais non.IWebBrowser2::LocationURL Property
--------------------------------------------------------------------------------
Retrieves the URL of the resource that Microsoft® Internet Explorer is currently displaying.
Syntax
HRESULT IWebBrowser2::get_LocationURL(BSTR *pbstrLocationURL);
Parameters
pbstrLocationURL
Pointer to a variable of type BSTR that receives the URL. The caller frees this buffer with the SysFreeString function.
Return Value
Returns S_OK if successful, or an error value otherwise.
Remarks
If the resource is a folder or file on the network or local computer, the name is the full path of the folder or file in the Universal Naming Convention (UNC) format.
Un petit coup de main serait le bienvenu!

PS : J'ai essayé aussi avec "MessageRequester("", Adress)", même punition