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