I use the following code to show system time. It success. But the time in label is static.
Can we show it dynamically?
invoke GetLocalTime, addr systime
invoke GetDateFormat, NULL, NULL, ADDR systime, ADDR DateFormat, ADDR szDate, 40
invoke GetTimeFormat, NULL, NULL, ADDR systime, ADDR TimeFormat, ADDR szTime, 20
invoke lstrcpy, addr strText, SADD("Date: ")
invoke lstrcat, addr strText, ADDR szDate
invoke lstrcat, addr strText, ADDR szCrLf
invoke lstrcat, addr strText, SADD("Time: ")
invoke lstrcat, addr strText, addr szTime
invoke SendMessage,hLabel,WM_SETTEXT,0,ADDR strText
invoke UpdateWindow,hLabel
You have to incorporate your code in a timer event.
Basically, you can set up a timer with SetTimer (http://msdn.microsoft.com/en-us/library/ms644906(VS.85).aspx), specifying an appropriate time-out value and timer identifier, and then catch the timer event in a WM_TIMER handler in your window procedure, or in a TimerProc (http://msdn.microsoft.com/en-us/library/ms644907(VS.85).aspx) callback.