Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
*SETTIME.PRG
LPARAMETERS tod_year, tod_month, tod_day, tod_Mins, tod_Hours, tod_Secs
Local lpTimeSet
lpTimeSet = "" ;
+ word2str(tod_year);
+ word2str(tod_month);
+ word2str(1);
+ word2str(tod_day);
+ word2str(tod_Hours);
+ word2str(tod_Mins);
+ word2str(tod_Secs);
+ word2str(0)
Declare INTEGER SetLocalTime in kernel32 STRING
l_nRetVal = SetLocalTime(lpTimeSet)
IF l_nRetVal = 0 && Error
DECLARE INTEGER GetLastError in Kernel32
l_nLastError = GetLastError()
**? l_nLastError
Declare Integer FormatMessage in kernel32 Long, Long, Long, Long, String, Long, Long
#DEFINE FORMAT_MESSAGE_FROM_SYSTEM 0x1000
#DEFINE LANG_NEUTRAL 0x0
l_cBuffer = replicate(chr(0), 201)
= FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, 0, l_nLastError, LANG_NEUTRAL, @l_cBuffer, 200, 0)
l_cBuffer = ALLTRIM(STRTRAN(l_cBuffer, chr(0),""))
messagebox(l_cBuffer, 0, "Please Note")
RETURN .F.
ENDIF
* Use SendMessage to tell everybody that we've changed the system time.
DECLARE INTEGER SendMessage IN win32api ;
INTEGER WindowHandle, ;
INTEGER MESSAGE, ;
STRING Param1, ;
STRING Param2
* SendMessage constants.
#DEFINE HWND_BROADCAST 65535
#DEFINE WM_TIMECHANGE 30
* Send the message that the time has changed.
= SendMessage(HWND_BROADCAST, WM_TIMECHANGE, "", "")
**? "New Local: ", datetime()
RETURN .T.
*************************************************************
FUNCTION word2str
*************************************************************
* passed: integer value
* returns: 2-byte character string (m.longstr) in low-high ASCII format
* example:
* m.wordval = 111
* m.wordstr = word2str(m.wordval)
PARAMETERS m.wordval
PRIVATE i, m.retval
m.retval = ""
FOR i = 0 to 1
m.retval = m.retval + CHR(m.wordval % 256)
m.wordval = int(wordval / 256)
NEXT
RETURN m.retval
*!* EOP: SETTIME.PRG