GetSystemTime example
Posted: Mon May 12, 2014 1:55 pm
Record SYSTEMTIME
wYear as word
wMonth as word
wDayOfWeek as word
wday as word
wHour as word
wMinute as word
wSecond as word
wMilliseconds as word
End record
Declare GetSystemTime as "GetSystemTime" of "Kernel32"
lpSystemTime as SYSTEMTIME
End Declare
Object frmForm as Form
Caption="Form"
Width=640
Height=480
Center
`BorderStyle=BsDialog
`Other objects
Object btnButton as Button
Tag=0
Top=10
left=10
`Width=100
`Height=30
Caption="Button1"
Hint="This is a button"
ShowHint=True
`Cursor=crHandPoint
`Bitmap.loadFromFile("bitmap.bmp")
OnClick=btnButton_OnClick
End Object
`End other objects
`Onshow=frmForm_Onshow
`Onclose=frmForm_Onclose
End Object
`frmForm.WindowState=WsMaximized
frmForm.Showmodal
Sub btnButton_OnClick
dim hora as word, minutos as word, segundos as word
GetSystemTime.Execute
hora=GetSystemTime.lpSystemTime.whour
Minutos=GetSystemTime.lpSystemTime.wMinute
segundos=GetSystemTime.lpSystemTime.wSecond
Showmessage str$(hora)+":"+str$(Minutos)+":"+str$(Segundos)
End Sub
wYear as word
wMonth as word
wDayOfWeek as word
wday as word
wHour as word
wMinute as word
wSecond as word
wMilliseconds as word
End record
Declare GetSystemTime as "GetSystemTime" of "Kernel32"
lpSystemTime as SYSTEMTIME
End Declare
Object frmForm as Form
Caption="Form"
Width=640
Height=480
Center
`BorderStyle=BsDialog
`Other objects
Object btnButton as Button
Tag=0
Top=10
left=10
`Width=100
`Height=30
Caption="Button1"
Hint="This is a button"
ShowHint=True
`Cursor=crHandPoint
`Bitmap.loadFromFile("bitmap.bmp")
OnClick=btnButton_OnClick
End Object
`End other objects
`Onshow=frmForm_Onshow
`Onclose=frmForm_Onclose
End Object
`frmForm.WindowState=WsMaximized
frmForm.Showmodal
Sub btnButton_OnClick
dim hora as word, minutos as word, segundos as word
GetSystemTime.Execute
hora=GetSystemTime.lpSystemTime.whour
Minutos=GetSystemTime.lpSystemTime.wMinute
segundos=GetSystemTime.lpSystemTime.wSecond
Showmessage str$(hora)+":"+str$(Minutos)+":"+str$(Segundos)
End Sub