Code : Tout sélectionner
#include <GuiRichEdit.au3>
#include <WindowsConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <ButtonConstants.au3>
#Include <String.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <WindowsConstants.au3>
#include <IE.au3>
OnAutoItExitRegister("_Exit")
Opt("GUIOnEventMode", 1)
Global $Site = IniRead(@scriptdir & "\settings.ini", "Site", "lien", "")
Global $Label_1 = "Search Prêt !"
Global $Fille_GUIDll = @ScriptDir & "\Bmp.dll"
Global $Refresher, $PIC_Bouton_Search, $PIC_Bouton_Stop, $String, $Statut, $InputText, $stop
_GUI()
Func _GUI()
; -################# GUI #################- ;
$Refresher = GUICreate("Refresh me", 320, 150, -1, -1, $WS_POPUP + $WS_MINIMIZEBOX)
GUICtrlCreatePic("", 0, 0, 320, 120)
_Bitmap(-1, $Bmp_GUI)
GUICtrlSetState(-1, $GUI_DISABLE)
GUICtrlCreateLabel("Refresh Me by Colin117", 8, 10, 270, 40)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor(-1, 0x00ae00)
GUICtrlSetFont(-1, 13, -1, 2, "Verdana")
$PIC_Bouton_Exit_GUI[0] = GUICtrlCreatePic("", 302, 4, 16, 16)
_Bitmap($PIC_Bouton_Exit_GUI[0], $Bmp_Exit)
$PIC_Bouton_Minimize_GUI[0] = GUICtrlCreatePic("", 284, 4, 16, 16)
_Bitmap($PIC_Bouton_Minimize_GUI[0], $Bmp_Minimize)
$PIC_Bouton_Search = GUICtrlCreatePic("", 225, 99, 90, 20)
_Bitmap($PIC_Bouton_Search, $Bmp_Freez)
$LABEL_Bouton_Freez[0] = GUICtrlCreateLabel("Search", 225, 98, 90, 20, $SS_CENTER)
GUICtrlSetBkColor($LABEL_Bouton_Search[0], $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($LABEL_Bouton_Search[0], 0x00ae00)
GUICtrlSetFont($LABEL_Bouton_Search[0], 13, -1, 2, "Verdana")
$PIC_Bouton_Stop = GUICtrlCreatePic("", 5, 99, 90, 20)
_Bitmap($PIC_Bouton_Stop, $Bmp_Stop)
$LABEL_Bouton_Stop[0] = GUICtrlCreateLabel("Stop", 5, 98, 90, 20, $SS_CENTER)
GUICtrlSetBkColor($LABEL_Bouton_Stop[0], $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetColor($LABEL_Bouton_Stop[0], 0x00ae00)
GUICtrlSetFont($LABEL_Bouton_Stop[0], 13, -1, 2, "Verdana")
$InputText = GUICtrlCreateInput("", 5, 50, 310, 20, $ES_AUTOVSCROLL)
GUICtrlSetData(-1, "")
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x00ff00)
GUICtrlSetBkColor(-1, 0x001000)
$Statut = GUICtrlCreateLabel($Label_1, 5, 128, 128, 20)
GUICtrlSetColor(-1, 0x00ae00)
GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT)
GUISetState(@SW_SHOW)
AdlibRegister("_GUI_", 100)
GUICtrlSetOnEvent($PIC_Bouton_Exit_GUI[0], "_Exit")
GUICtrlSetOnEvent($PIC_Bouton_Minimize_GUI[0], "_Minimize")
GUICtrlSetOnEvent($LABEL_Bouton_Search[0], "b_Search")
GUICtrlSetOnEvent($LABEL_Bouton_Stop[0], "b_Stop")
; -################# GUI #################- ;
EndFunc
While 1
sleep(1)
WEnd
Func b_Search()
$stop = 0
$String = GUICtrlRead($InputText)
_Search($Stringl)
EndFunc
Func b_Stop()
$stop = 1
EndFunc
Func _Search($input)
If $Input <> "" Then
$oIE = _IECreate($Site, 0, 1, 1, 0)
While 1
If $stop = 0 Then
If on a trouver la string dans la page
_IEQuit($oIE)
GUICtrlSetData($Statut, "Rafraîchissement stopper.")
ExitLoop
Else
;Scan de la page web
_IELoadWait($oIE)
AdlibRegister("_GUI_", 100) ; Pour les OVERS, marche.
GUICtrlSetOnEvent($PIC_Bouton_Exit_GUI[0], "_Exit") ; Pour les boutons, marche pas :/
GUICtrlSetOnEvent($PIC_Bouton_Minimize_GUI[0], "_Minimize"); Pour les boutons, marche pas :/
GUICtrlSetOnEvent($LABEL_Bouton_Freez[0], "b_Freez"); Pour les boutons, marche pas :/
GUICtrlSetOnEvent($LABEL_Bouton_UnFreez[0], "b_UnFreez"); Pour les boutons, marche pas :/
GUICtrlSetData($Statut, "Attente de la news"); Change un Label sur la GUI (marche)
EndIf
Else
_IEQuit($oIE)
GUICtrlSetData($Statut, "Rafraîchissement stopper.")
ExitLoop
EndIf
WEnd
Else
MsgBox(64, "Erreur", "Veuillez entrer une adresse Hotmail S'il vous plait !")
EndIf
EndFunc
Func _Minimize()
GUISetState(@SW_MINIMIZE)
EndFunc ;==>_Minimize
Func _Exit()
Exit
EndFunc ;==>_Exit