Erra Posted July 25, 2008 Posted July 25, 2008 expandcollapse popup#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 :<
PsaltyDS Posted July 25, 2008 Posted July 25, 2008 expandcollapse popup#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 :< That's because MainLoop() is never executed until Window() returns. And Window() does not return until the GUI is closed. Either you need to combine the two, or learn to use GuiOnEventMode. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Erra Posted July 25, 2008 Author Posted July 25, 2008 Hah, you're right! Didn't think of that, thank you
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now