Page 1 sur 1

[..] Choper l'url en haut dans internet explorer

Posté : dim. 20 juil. 2008 09:51
par d3v1lm33
Bonjour j'aimerais un script qui me msgbox l'url que je suis en train de regarder, peut importe la manière mais il faut que se soit une variable chaine de caractère c'est tout.

Re: [...] Choper l'url en haut dans internet explorer

Posté : ven. 25 juil. 2008 01:46
par genaille08
une variable chaine de caractère
qu'est-ce ???

et pourquoi veu tu creer un script comme ca
un copier/coller suffit ??? non

Re: [...] Choper l'url en haut dans internet explorer

Posté : dim. 27 juil. 2008 00:26
par jbnh
ControlGetText doit fonctionner non? ou alors avec l'include ie.au3

Re: [...] Choper l'url en haut dans internet explorer

Posté : jeu. 07 août 2008 21:05
par Artemis
Je relance le sujet :)

Voila un code qui marche chez moi :

Code : Tout sélectionner

#NoTrayIcon
#include <IE.au3>
Opt("WinTitleMatchMode", 2)

$h=WinGetHandle("Internet Explorer")
$oIE = _IEAttach($h, "HWND")
$url = _IEPropertyGet($oIE, "locationurl")

MsgBox(64,"Internet Explorer",$url)

Re: [..] Choper l'url en haut dans internet explorer

Posté : lun. 22 sept. 2008 15:17
par coincoin
J'ai bien comprit la demende et le code donné par Artemis est bon, mais peut-on m'expliqué la ligne:

Code : Tout sélectionner

$oIE = _IEAttach($h, "HWND")
Merci

Re: [..] Choper l'url en haut dans internet explorer

Posté : lun. 22 sept. 2008 16:31
par jbnh
Pour associer le location url à la fenêtre de internet explorer.
; Function Name: _IEAttach()
; Description: Attach to the first existing instance of Internet Explorer where the
; search string sub-string matches based on the selected mode.
; Parameter(s): $s_string - String to search for (for "embedded" or "dialogbox", use Title sub-string or HWND of window)
; $s_mode - Optional: specifies search mode
; Title = (Default) browser title
; URL = url of the current page
; Text = text from the body of the current page
; HTML = html from the body of the current page
; HWND = hwnd of the browser window
; Embedded = title sub-string or hwnd of the window embedding the control
; DialogBox = title sub-string or hwnd of modal/modeless dialogbox

Re: [..] Choper l'url en haut dans internet explorer

Posté : jeu. 02 oct. 2008 14:12
par henriclaessens
Hello,

Je peux te proposer ceci:

Tu lances et tu voyages avec la fenêtre créée par le code.
Quand tu changes de page ça t'envoie un message avec l'url.
Le code s'arrête quand tu fermes la fenêtre.

Code : Tout sélectionner

#include <IE.au3> 

$Test=True
$url=""

while 1
    if $Test=True Then
        $io=_IECreate ()
        _IEAction ( $io, "home")
        $url=_IEPropertyGet ($io, "locationurl")
        $Test=False
    EndIf
    
    If @error == 0 Then
        If $url <> _IEPropertyGet ($io, "locationurl") Then
            $url=_IEPropertyGet ($io, "locationurl")
            MsgBox(0,"Page visitée",$url)
        EndIf
    Else
        Exit
    EndIf
WEnd
 
A+
Henri