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