News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how to show system time dynamically?

Started by elmo, December 26, 2010, 05:16:21 AM

Previous topic - Next topic

elmo

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
be the king of accounting programmer world!

Tight_Coder_Ex

You have to incorporate your code in a timer event.

MichaelW

Basically, you can set up a timer with SetTimer, 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 callback.
eschew obfuscation