ecdb2a5f1adbde1a950a448fdad115d93fb9ece2
[reactos.git] / reactos / dll / cpl / timedate / timedate.h
1 #include <stdarg.h>
2
3 #define _INC_WINDOWS
4 #define COM_NO_WINDOWS_H
5 #define WIN32_NO_STATUS
6
7 #include <windef.h>
8 #include <winbase.h>
9 #include <winnls.h>
10 #include <winreg.h>
11 #include <wingdi.h>
12 #include <winuser.h>
13 #include <wchar.h>
14 #include <commctrl.h>
15 #include <cpl.h>
16
17 #include "resource.h"
18
19 #define MAX_KEY_LENGTH 255
20 #define MAX_VALUE_NAME 16383
21 #define SERVERLISTSIZE 6
22 #define BUFSIZE 1024
23 #define NTPPORT 123
24 #define ID_TIMER 1
25
26 typedef struct
27 {
28 UINT idIcon;
29 UINT idName;
30 UINT idDescription;
31 APPLET_PROC AppletProc;
32 } APPLET, *PAPPLET;
33
34 extern HINSTANCE hApplet;
35
36
37 /* dateandtime.c */
38 INT_PTR CALLBACK DateTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
39 BOOL SystemSetLocalTime(LPSYSTEMTIME lpSystemTime);
40
41
42 /* timezone.c */
43 INT_PTR CALLBACK TimeZonePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
44
45
46 /* internettime.c */
47 INT_PTR CALLBACK InetTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
48
49
50 /* timedate.c */
51 #if DBG
52 VOID DisplayWin32ErrorDbg(DWORD dwErrorCode, const char *file, int line);
53 #define DisplayWin32Error(e) DisplayWin32ErrorDbg(e, __FILE__, __LINE__);
54 #else
55 VOID DisplayWin32Error(DWORD dwErrorCode);
56 #endif
57
58
59 /* clock.c */
60 #define CLM_STOPCLOCK (WM_USER + 1)
61 #define CLM_STARTCLOCK (WM_USER + 2)
62
63 BOOL RegisterClockControl(VOID);
64 VOID UnregisterClockControl(VOID);
65
66
67 /* ntpclient.c */
68 // NTP timestamp
69 typedef struct _TIMEPACKET
70 {
71 DWORD dwInteger;
72 DWORD dwFractional;
73 } TIMEPACKET, *PTIMEPACKET;
74
75 // NTP packet
76 typedef struct _NTPPACKET
77 {
78 BYTE LiVnMode;
79 BYTE Stratum;
80 char Poll;
81 char Precision;
82 long RootDelay;
83 long RootDispersion;
84 char ReferenceID[4];
85 TIMEPACKET ReferenceTimestamp;
86 TIMEPACKET OriginateTimestamp;
87 TIMEPACKET ReceiveTimestamp;
88 TIMEPACKET TransmitTimestamp;
89 }NTPPACKET, *PNTPPACKET;
90
91 ULONG GetServerTime(LPWSTR lpAddress);
92
93
94 /* monthcal.c */
95 #define MCCM_SETDATE (WM_USER + 1)
96 #define MCCM_GETDATE (WM_USER + 2)
97 #define MCCM_RESET (WM_USER + 3)
98 #define MCCM_CHANGED (WM_USER + 4)
99
100 #define MCCN_SELCHANGE (1)
101 typedef struct _NMMCCSELCHANGE
102 {
103 NMHDR hdr;
104 WORD OldDay;
105 WORD OldMonth;
106 WORD OldYear;
107 WORD NewDay;
108 WORD NewMonth;
109 WORD NewYear;
110 } NMMCCSELCHANGE, *PNMMCCSELCHANGE;
111 #define MCCN_AUTOUPDATE (2)
112 typedef struct _NMMCCAUTOUPDATE
113 {
114 NMHDR hdr;
115 SYSTEMTIME SystemTime;
116 } NMMCCAUTOUPDATE, *PNMMCCAUTOUPDATE;
117
118 BOOL RegisterMonthCalControl(IN HINSTANCE hInstance);
119 VOID UnregisterMonthCalControl(IN HINSTANCE hInstance);
120
121 /* EOF */