Sign in to follow this  
Followers 0
funkey

Script stops with dateselector or menu

1 post in this topic

#1 ·  Posted (edited)

#include <DateTimeConstants.au3>

GUICreate("Date", 350, 70)

GUICtrlCreateMenuItem("Test", GUICtrlCreateMenu("Test"))
GUICtrlCreateDate("", 20, 15, 200, 20)
$time = GUICtrlCreateLabel(@HOUR & ":" & @MIN & ":" & @SEC, 250, 15, 100, 20, 0x201)

GUISetState()
AdlibEnable("_Time", 1000)

Do
Until GUIGetMsg() = -3

Func _Time()
GUICtrlSetData($time, @HOUR & ":" & @MIN & ":" & @SEC)
EndFunc

Edit: Sorry, i found it: _Timer_SetTimer works!!

#include <DateTimeConstants.au3>
#Include <Timers.au3>

$hGui = GUICreate("Date", 350, 70)

GUICtrlCreateMenuItem("Test", GUICtrlCreateMenu("Test"))
GUICtrlCreateDate("", 20, 15, 200, 20)
$time = GUICtrlCreateLabel(@HOUR & ":" & @MIN & ":" & @SEC, 250, 15, 100, 20, 0x201)

GUISetState()

$timer = _Timer_SetTimer($hGui, 1000, "_Time")

Do
Until GUIGetMsg() = -3

Func _Time($hWnd, $Msg, $iIDTimer, $dwTime)
 GUICtrlSetData($time, @HOUR & ":" & @MIN & ":" & @SEC)
EndFunc

_Timer_KillTimer($hGui, $timer)
Edited by funkey

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

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  
Followers 0