FreeBASIC  0.91.0
time_setdate.c
Go to the documentation of this file.
1 #include "../fb.h"
2 #include <windows.h>
3 
4 int fb_hSetDate( int y, int m, int d )
5 {
6  /* get current local time and date */
7  SYSTEMTIME st;
8  GetLocalTime( &st );
9 
10  /* set time fields */
11  st.wYear = y;
12  st.wMonth = m;
13  st.wDay = d;
14 
15  /* set system time relative to local time zone */
16  if( SetLocalTime( &st ) == 0) {
17  return -1;
18  }
19 
20  /* send WM_TIMECHANGE to all top-level windows on NT and 95/98/Me
21  * (_not_ on 2K/XP etc.) */
22  /* if ((GetVersion() & 0xFF) == 4)
23  SendMessage(HWND_BROADCAST, WM_TIMECHANGE, 0, 0); */
24 
25  return 0;
26 }