#include <GUIConstants.au3>
#include <Array.au3>
global $msg, $checkright, $quit, $inhalt1
GUICreate("Capture a screenshot at a certain time", 400, 100,10,10)
CreateGui()
GUISetState() ; display the GUI
Window()
MainLoop()
Func Window()
Do
$msg = GUIGetMsg()
Select
Case $msg= $GUI_EVENT_CLOSE
MsgBox(0, "HU", "Good bye")
$quit = 1
EndSelect
Until $msg = $GUI_EVENT_CLOSE
EndFunc
Func API_GetLocalTime()
Local $stSystemTime = DllStructCreate('ushort;ushort;ushort;ushort;ushort;ushort;ushort;ushort')
DllCall('kernel32.dll', 'none', 'GetLocalTime', 'ptr', DllStructGetPtr($stSystemTime))
Local $gst=DllStructGetData($stSystemTime, 5)
For $i = 6 to 6
$gst = $gst & ":" & DllStructGetData($stSystemTime, $i)
Next
$stSystemTime = 0 ; free structure from memory
return $gst
EndFunc
Func CreateGui()
$checkright = GUICtrlCreateCheckbox ("Activated", 30, 10)
$inhalt1 = GUICtrlCreateInput (API_GetLocalTime(), 250, 30, 100)
$SRL = GUICtrlCreateLabel("Time to take screenshot:", 70, 30, 200)
GUICtrlSetFont($SRL,9,600)
EndFunc
Func MainLoop()
Do
if(GUICtrlRead($checkright)=1) Then
if(API_GetLocalTime()=GUICtrlRead($inhalt1)) Then
$hPlugin = PluginOpen(@scriptdir & "\captplugin.dll")
CaptureScreen("Bottat.bmp", 100)
PluginClose($hPlugin)
EndIf
endif
Until $quit = "1"
EndFunc
Credits to the ones who made the other functions I use, but what am I doing wrong since this ONLY takes a screenshot when I CLOSE the program :<