I am having a problem with updating a DTP control with the correct date once the script has ran, can somebody try this code for me;
Turn your PC date back one day, run the code below, turn your PC date back to today and click the Update button, shouldn't the DTP update to the current date (@MDAY) or am I doing this wrong?
The @MDAY is correct when written to the console.
#include <GUIConstantsEx.au3>
#include <GuiDateTimePicker.au3>
#include <WindowsConstants.au3>
Global $g_hDTP
Example()
Func Example()
Local $hGUI
; Create GUI
$hGUI = GUICreate("(UDF Created) DateTimePick Create", 400, 300)
$g_hDTP = _GUICtrlDTP_Create($hGUI, 2, 6, 190)
$btnTest = GUICtrlCreateButton( "Update", 200, 6, 100, 20 )
GUISetState(@SW_SHOW)
; Loop until the user exits.
; Loop until the user exits.
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
Exit
Case $btnTest
btnTest()
EndSwitch
WEnd
EndFunc
Func btnTest()
Local $sDate[7] = [ False, @YEAR, @MON, @MDAY, 0, 0, 0 ]
_GUICtrlDTP_SetSystemTime( GUICtrlGetHandle($g_hDTP), $sDate )
ConsoleWrite( "MDAY: " & @MDAY & @CRLF )
EndFunc
Thanks