Case $Button1
Case ^ ERROR
je n'ai pas trop compris l’erreur , alors je vous montre le code :
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <webcam.au3>
#include <ScreenCapture.au3>
#include <Timers.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1_1 = GUICreate("Autoit surveillance", 380, 236, 383, 42)
GUISetBkColor(0xFFFFFF)
Global $Label1 = GUICtrlCreateLabel("Autoit", 48, 8, 86, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Verdana")
GUICtrlSetColor(-1, 0x000000)
Global $Label2 = GUICtrlCreateLabel("Surveillance", 144, 0, 189, 48)
GUICtrlSetFont(-1, 20, 800, 0, "Segoe Script")
GUICtrlSetColor(-1, 0x000000)
Global $Label3 = GUICtrlCreateLabel("By Kevzi", 304, 48, 53, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Label4 = GUICtrlCreateLabel("V.locale", 48, 48, 50, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Pic1 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\evjosoft-37178.gif", 272, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label5 = GUICtrlCreateLabel("image", 312, 136, 32, 17)
Global $Pic2 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\webcam.gif", 8, 104, 48, 48, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label6 = GUICtrlCreateLabel("Webcam", 56, 136, 47, 17)
Global $Pic3 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\keylogger.jpg", 128, 104, 50, 50, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label7 = GUICtrlCreateLabel("Keylogger", 184, 136, 51, 17)
Global $Group1 = GUICtrlCreateGroup("Fonctions", 8, 80, 361, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Pic1
#Region ### START Koda GUI section ### Form=
Global $Form2 = GUICreate("Capture écran", 206, 222, 481, 156)
Global $Input2 = GUICtrlCreateInput("", 40, 64, 121, 21)
Global $Label2 = GUICtrlCreateLabel("Temps de capture", 48, 32, 90, 17)
Global $Label3 = GUICtrlCreateLabel("(60000 = 1minute)", 56, 104, 85, 17)
$Button1 = GUICtrlCreateButton("Capturer", 16, 160, 75, 25, $WS_GROUP)
Global $Button2 = GUICtrlCreateButton("Stop", 112, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
Case $Pic2
#Region ### START Koda GUI section ### Form=
Global $Form3 = GUICreate("Func Webcam", 336, 294, 259, 160)
Global $Buttond = GUICtrlCreateButton("Demarrer", 32, 264, 75, 25, $WS_GROUP)
Global $Buttons = GUICtrlCreateButton("stop", 208, 264, 75, 25, $WS_GROUP)
$ID = _Webcam_Open($Form3, 50, 5, 225, 233)
; Parameter(s): $sHwnd - The handle of the gui
; $sLeft - Left coord. of the preview screen
; $sTop - Top coord. of the preview screen
; $sWidth - Width of the preview screen
; $sHeight - Height of the preview screen
; $WebCamId - The capture driver to open
Sleep(500)
_Webcam_Preview_Start($ID)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Case $Button1
capture()
GUISetState(@SW_HIDE)
Case $Buttond
_Webcam_Rec_Start("cam.avi", $ID)
Case $Buttons
_Webcam_Rec_Stop($ID)
EndSwitch
WEnd
Func capture()
Do
$rand = Random(1,1000,1)
Local $hBmp
Sleep(GUICtrlRead($Input2))
; Capture full screen
$hBmp = _ScreenCapture_Capture ("")
; Save bitmap to file
_ScreenCapture_SaveImage ($rand&"surveillance.jpg", $hBmp)
Until $hBmp = 50
EndFunc ;==>_Mainj'ai essayé comme ça :
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <webcam.au3>
#include <ScreenCapture.au3>
#include <Timers.au3>
#Region ### START Koda GUI section ### Form=
Global $Form1_1 = GUICreate("Autoit surveillance", 380, 236, 383, 42)
GUISetBkColor(0xFFFFFF)
Global $Label1 = GUICtrlCreateLabel("Autoit", 48, 8, 86, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Verdana")
GUICtrlSetColor(-1, 0x000000)
Global $Label2 = GUICtrlCreateLabel("Surveillance", 144, 0, 189, 48)
GUICtrlSetFont(-1, 20, 800, 0, "Segoe Script")
GUICtrlSetColor(-1, 0x000000)
Global $Label3 = GUICtrlCreateLabel("By Kevzi", 304, 48, 53, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Label4 = GUICtrlCreateLabel("V.locale", 48, 48, 50, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Pic1 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\evjosoft-37178.gif", 272, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label5 = GUICtrlCreateLabel("image", 312, 136, 32, 17)
Global $Pic2 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\webcam.gif", 8, 104, 48, 48, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label6 = GUICtrlCreateLabel("Webcam", 56, 136, 47, 17)
Global $Pic3 = GUICtrlCreatePic("C:\Users\Kevin\Pictures\keylogger.jpg", 128, 104, 50, 50, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label7 = GUICtrlCreateLabel("Keylogger", 184, 136, 51, 17)
Global $Group1 = GUICtrlCreateGroup("Fonctions", 8, 80, 361, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Pic1
#Region ### START Koda GUI section ### Form=
Global $Form2 = GUICreate("Capture écran", 206, 222, 481, 156)
Global $Input2 = GUICtrlCreateInput("", 40, 64, 121, 21)
Global $Label2 = GUICtrlCreateLabel("Temps de capture", 48, 32, 90, 17)
Global $Label3 = GUICtrlCreateLabel("(60000 = 1minute)", 56, 104, 85, 17)
$Button1 = GUICtrlCreateButton("Capturer", 16, 160, 75, 25, $WS_GROUP)
Global $Button2 = GUICtrlCreateButton("Stop", 112, 160, 75, 25, $WS_GROUP)
GUISetState(@SW_SHOW)
Case $GUI_EVENT_CLOSE
Exit
If $Button1 Then
capture()
GUISetState(@SW_HIDE)
EndIf
Case $Pic2
#Region ### START Koda GUI section ### Form=
Global $Form3 = GUICreate("Func Webcam", 336, 294, 259, 160)
Global $Buttond = GUICtrlCreateButton("Demarrer", 32, 264, 75, 25, $WS_GROUP)
Global $Buttons = GUICtrlCreateButton("stop", 208, 264, 75, 25, $WS_GROUP)
$ID = _Webcam_Open($Form3, 50, 5, 225, 233)
; Parameter(s): $sHwnd - The handle of the gui
; $sLeft - Left coord. of the preview screen
; $sTop - Top coord. of the preview screen
; $sWidth - Width of the preview screen
; $sHeight - Height of the preview screen
; $WebCamId - The capture driver to open
Sleep(500)
_Webcam_Preview_Start($ID)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
Case $GUI_EVENT_CLOSE
Exit
If $Buttond Then
_Webcam_Rec_Start("cam.avi", $ID)
EndIf
if $Buttons Then
_Webcam_Rec_Stop($ID)
EndIf
Case $GUI_EVENT_CLOSE
Exit
EndSwitch
WEnd
Func capture()
Do
$rand = Random(1,1000,1)
Local $hBmp
Sleep(GUICtrlRead($Input2))
; Capture full screen
$hBmp = _ScreenCapture_Capture ("")
; Save bitmap to file
_ScreenCapture_SaveImage ($rand&"surveillance.jpg", $hBmp)
Until $hBmp = 50
EndFunc ;==>_MainEdit: grosse amélioration du script (en terme de lisibilité et de cohérence). juger pas vous même
► Afficher le texte
Code : Tout sélectionner
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#include <webcam.au3>
#include <ScreenCapture.au3>
#include <Timers.au3>
$dir = @ScriptDir & "\espionnage_image\" ;Rajoute un dossier pour la capture d'image.
HotKeySet("{F2}", "afficher_fenetre") ;Si la touche "F2" est pressée, appelle de la fonction "afficher_fenetre".
HotKeySet("{F3}", "cacher_fenetre");Si la touche "F3" est pressée, appelle de la fonction "cacher_fenetre".
;########-------######### GUI1 #########-------########
Global $Form1_1 = GUICreate("Autoit surveillance", 380, 236, 383, 42)
GUISetBkColor(0xFFFFFF)
Global $Label1 = GUICtrlCreateLabel("Autoit", 48, 8, 86, 33)
GUICtrlSetFont(-1, 18, 800, 0, "Verdana")
GUICtrlSetColor(-1, 0x000000)
Global $Label2 = GUICtrlCreateLabel("Surveillance", 144, 0, 189, 48)
GUICtrlSetFont(-1, 20, 800, 0, "Segoe Script")
GUICtrlSetColor(-1, 0x000000)
Global $Label3 = GUICtrlCreateLabel("By Kevzi", 304, 48, 53, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Label4 = GUICtrlCreateLabel("V.locale", 48, 48, 50, 17)
GUICtrlSetFont(-1, 8, 800, 0, "MS Sans Serif")
GUICtrlSetColor(-1, 0x000000)
Global $Pic1 = GUICtrlCreatePic(@ScriptDir&"\data\evjosoft-37178.gif", 272, 120, 32, 32, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label5 = GUICtrlCreateLabel("image", 312, 136, 32, 17)
Global $Pic2 = GUICtrlCreatePic(@ScriptDir&"\data\webcam.gif", 8, 104, 48, 48, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label6 = GUICtrlCreateLabel("Webcam", 56, 136, 47, 17)
Global $Pic3 = GUICtrlCreatePic(@ScriptDir&"\data\keylogger.jpg", 128, 104, 50, 50, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
Global $Label7 = GUICtrlCreateLabel("Keylogger", 184, 136, 51, 17)
Global $Group1 = GUICtrlCreateGroup("Fonctions", 8, 80, 361, 105)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
;########################################################################################################################################
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Pic1
MsgBox(64,"func capture","captures enclenchées")
capture() ;appelle de la fonction "capture"
Case $GUI_EVENT_CLOSE
Exit
Case $Pic2
;########-------######### GUI2 #########-------########
Global $Form3 = GUICreate("Func Webcam", 336, 294, 259, 160)
Global $Buttond = GUICtrlCreateButton("Demarrer", 32, 264, 75, 25, $WS_GROUP)
Global $Buttons = GUICtrlCreateButton("stop", 208, 264, 75, 25, $WS_GROUP)
$ID = _Webcam_Open($Form3, 50, 5, 225, 233) ; Permet de mettre ce que visionne la webcam dans la GUI.
Sleep(500)
_Webcam_Preview_Start($ID) ;Ouvre la webcam.
GUISetState(@SW_SHOW)
;########-------#########---------------------#########-------########
If $Buttond Then ; si le bouton "demarrer" est cliqué alors
_Webcam_Rec_Start(@ScriptDir&"\espionnage_webcam\cam.avi", $ID); la webcam enregistre "cam.avi" dans le dossier spécifié.
EndIf
if $Buttons Then ;si le bouton "stop" est cliqué alors
_Webcam_Rec_Stop($ID) ;fin de l'enregistrement de cam.avi.
EndIf
Case $GUI_EVENT_CLOSE
Exit
Case $Pic3
MsgBox(64,"func keylogger" , "la fonction keylogger n'est pas encore achevée...patience ;)")
EndSwitch
WEnd
Func capture() ;fonction capture
Local $hBmp
Do
$rand = Random(1,1000,1) ; génère un nombre au hasard entre 1 et 1000 (le 1 après le 1000 veut dire qu'on veut un nombre entier)
$hBmp = _ScreenCapture_Capture ("") ;prend une capture de l'ecran
_ScreenCapture_SaveImage ($dir&$rand&"surveillance.jpg", $hBmp); la capture de l'ecran est enregistré dans le dossier
Until $hBmp = Sleep(60000) ; refaire la capture toutes les minutes
EndFunc ; ==> fin de la fonction
func afficher_fenetre() ;Fontion "afficher_fenêtre"
GUISetState(@SW_SHOW) ;La GUI est affichée.
EndFunc ; ==> fin de la fonction
func cacher_fenetre() ;Fonction "cacher_fenêtre"
GUISetState(@SW_HIDE) ;La GUI est cachée.
EndFunc ; ==> fin de la fonction


