This funcion requires a pointer to structure SYSTEMTIME:
void WINAPI GetLocalTime(And after calling this function this structure will be filled with data:
__out LPSYSTEMTIME lpSystemTime
);
typedef struct _SYSTEMTIME {Here is Pocket Scheme code that imports function GetLocalTime and usage.
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME,
*PSYSTEMTIME;
(require "w32.dll")
(define *kdll*
(cond-expand
(windows-nt "kernel32.dll")
(windows-ce "coredll.dll")))
(define GetLocalTime
(w32:foreign-procedure *kdll* "GetLocalTime" '(w32api void lpvoid)))
; outputs current year
(let ((rgw (make-raw-vector 8 'u16)))
(begin
(GetLocalTime rgw)
(display (raw-vector-ref rgw 0)) ; outputs current year
)
)
No comments:
Post a Comment