Jump to content
Sign in to follow this  


Recommended Posts

Skip opening the control

Right out of the help

#include <GuiConstantsEx.au3>
#include <Date.au3>

Global $iMemo


Func _Main()
    Local $hGUI, $tCur, $tNew

    ; Create GUI
    $hGUI = GUICreate("Time", 400, 300)
    $iMemo = GUICtrlCreateEdit("", 2, 2, 396, 296, $WS_VSCROLL)
    GUICtrlSetFont($iMemo, 9, 400, 0, "Courier New")

    ; Get current system time
    $tCur = _Date_Time_GetSystemTime()
    MemoWrite("Current system date/time .: " & _Date_Time_SystemTimeToDateTimeStr($tCur))

    ; Set new system time
    $tNew = _Date_Time_EncodeSystemTime(8, 19, @YEAR, 3, 10, 45)
    $tNew = _Date_Time_GetSystemTime()
    MemoWrite("New system date/time .....: " & _Date_Time_SystemTimeToDateTimeStr($tNew))

    ; Restore system time

    ; Get current system time
    $tCur = _Date_Time_GetSystemTime()
    MemoWrite("Current system date/time .: " & _Date_Time_SystemTimeToDateTimeStr($tCur))

    ; Loop until user exits
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>_Main

; Write a line to the memo control
Func MemoWrite($sMessage)
    GUICtrlSetData($iMemo, $sMessage & @CRLF, 1)
EndFunc   ;==>MemoWrite

SciTE for AutoItDirections for Submitting Standard UDFs


Don't argue with an idiot; people watching may not be able to tell the difference.


Share this post

Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...