ReactOS 0.4.15-dev-7942-gd23573b
timedate.c File Reference
#include "timedate.h"
Include dependency graph for timedate.c:

Go to the source code of this file.

Macros

#define NUM_APPLETS   1
 

Functions

static LONG APIENTRY Applet (HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
 
VOID DisplayWin32Error (DWORD dwErrorCode)
 
static VOID InitPropSheetPage (PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
 
static int CALLBACK PropSheetProc (HWND hwndDlg, UINT uMsg, LPARAM lParam)
 
LONG CALLBACK CPlApplet (HWND hwndCpl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
 
BOOL WINAPI DllMain (HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpReserved)
 

Variables

HINSTANCE hApplet
 
APPLET Applets [NUM_APPLETS]
 

Macro Definition Documentation

◆ NUM_APPLETS

#define NUM_APPLETS   1

Definition at line 13 of file timedate.c.

Function Documentation

◆ Applet()

static LONG APIENTRY Applet ( HWND  hwnd,
UINT  uMsg,
LPARAM  wParam,
LPARAM  lParam 
)
static

Definition at line 88 of file timedate.c.

89{
91 PROPSHEETPAGEW psp[3];
92 LONG Ret = 0;
93
97
100 {
101 ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
102 psh.dwSize = sizeof(PROPSHEETHEADERW);
104 psh.hwndParent = hwnd;
105 psh.hInstance = hApplet;
106 psh.pszIcon = MAKEINTRESOURCEW(IDC_CPLICON);
107 psh.pszCaption = MAKEINTRESOURCEW(IDS_CPLNAME);
108 psh.nPages = sizeof(psp) / sizeof(PROPSHEETPAGEW);
109 psh.nStartPage = 0;
110 psh.ppsp = psp;
111 psh.pfnCallback = PropSheetProc;
112
116
117 Ret = (LONG)(PropertySheetW(&psh) != -1);
118
121 }
122
123 return Ret;
124}
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
INT_PTR CALLBACK DateTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dateandtime.c:265
#define IDC_CPLICON
Definition: resource.h:7
#define IDS_CPLNAME
Definition: resource.h:8
VOID UnregisterClockControl(VOID)
Definition: clock.c:299
BOOL RegisterClockControl(VOID)
Definition: clock.c:283
BOOL RegisterMonthCalControl(IN HINSTANCE hInstance)
Definition: monthcal.c:1097
VOID UnregisterMonthCalControl(IN HINSTANCE hInstance)
Definition: monthcal.c:1114
#define IDD_INETTIMEPAGE
Definition: resource.h:21
#define IDD_TIMEZONEPAGE
Definition: resource.h:15
#define IDD_DATETIMEPAGE
Definition: resource.h:5
INT_PTR WINAPI PropertySheetW(LPCPROPSHEETHEADERW lppsh)
Definition: propsheet.c:2913
INT_PTR CALLBACK InetTimePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: internettime.c:381
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
long LONG
Definition: pedump.c:60
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSH_PROPTITLE
Definition: prsht.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
#define PSH_PROPSHEETPAGE
Definition: prsht.h:43
#define PSH_USEICONID
Definition: prsht.h:42
struct _PROPSHEETHEADERW PROPSHEETHEADERW
static VOID InitPropSheetPage(PROPSHEETPAGEW *psp, WORD idDlg, DLGPROC DlgProc)
Definition: timedate.c:60
static int CALLBACK PropSheetProc(HWND hwndDlg, UINT uMsg, LPARAM lParam)
Definition: timedate.c:71
HINSTANCE hApplet
Definition: timedate.c:17
INT_PTR CALLBACK TimeZonePageProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: timezone.c:272
#define ZeroMemory
Definition: winbase.h:1712
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582

◆ CPlApplet()

LONG CALLBACK CPlApplet ( HWND  hwndCpl,
UINT  uMsg,
LPARAM  lParam1,
LPARAM  lParam2 
)

Definition at line 129 of file timedate.c.

133{
134 UINT i = (UINT)lParam1;
135
136 switch (uMsg)
137 {
138 case CPL_INIT:
139 return TRUE;
140
141 case CPL_GETCOUNT:
142 return NUM_APPLETS;
143
144 case CPL_INQUIRE:
145 if (i < NUM_APPLETS)
146 {
147 CPLINFO *CPlInfo = (CPLINFO*)lParam2;
148 CPlInfo->lData = 0;
149 CPlInfo->idIcon = Applets[i].idIcon;
150 CPlInfo->idName = Applets[i].idName;
151 CPlInfo->idInfo = Applets[i].idDescription;
152 }
153 else
154 {
155 return TRUE;
156 }
157 break;
158
159 case CPL_DBLCLK:
160 if (i < NUM_APPLETS)
161 Applets[i].AppletProc(hwndCpl, uMsg, lParam1, lParam2);
162 else
163 return TRUE;
164 break;
165 }
166 return FALSE;
167}
#define CPL_INQUIRE
Definition: cpl.h:14
#define CPL_DBLCLK
Definition: cpl.h:16
#define CPL_INIT
Definition: cpl.h:12
#define CPL_GETCOUNT
Definition: cpl.h:13
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
unsigned int UINT
Definition: ndis.h:50
int idDescription
Definition: hotplug.h:37
int idName
Definition: hotplug.h:36
int idIcon
Definition: hotplug.h:35
APPLET_PROC AppletProc
Definition: hotplug.h:38
Definition: cpl.h:24
LONG_PTR lData
Definition: cpl.h:28
int idName
Definition: cpl.h:26
int idInfo
Definition: cpl.h:27
int idIcon
Definition: cpl.h:25
#define NUM_APPLETS
Definition: timedate.c:13
APPLET Applets[NUM_APPLETS]
Definition: timedate.c:20

◆ DisplayWin32Error()

VOID DisplayWin32Error ( DWORD  dwErrorCode)

Definition at line 28 of file timedate.c.

30{
31 PWSTR lpMsgBuf;
32#if DBG
33 WCHAR szMsg[255];
34#endif
35
39 NULL,
40 dwErrorCode,
42 (LPWSTR) &lpMsgBuf,
43 0,
44 NULL );
45
46#if DBG
47 if (swprintf(szMsg, L"%hs:%d: %s", file, line, (PWSTR)lpMsgBuf))
48 {
50 }
51#else
52 MessageBox(NULL, lpMsgBuf, NULL, MB_OK | MB_ICONERROR);
53#endif
54
55 LocalFree(lpMsgBuf);
56}
#define NULL
Definition: types.h:112
DWORD WINAPI FormatMessageW(DWORD dwFlags, LPCVOID lpSource, DWORD dwMessageId, DWORD dwLanguageId, LPWSTR lpBuffer, DWORD nSize, __ms_va_list *args)
Definition: format_msg.c:583
#define swprintf
Definition: precomp.h:40
HLOCAL NTAPI LocalFree(HLOCAL hMem)
Definition: heapmem.c:1594
#define L(x)
Definition: ntvdm.h:50
#define LANG_NEUTRAL
Definition: nls.h:22
#define MAKELANGID(p, s)
Definition: nls.h:15
#define SUBLANG_DEFAULT
Definition: nls.h:168
Definition: fci.c:127
Definition: parser.c:49
uint16_t * PWSTR
Definition: typedefs.h:56
#define FORMAT_MESSAGE_IGNORE_INSERTS
Definition: winbase.h:420
#define FORMAT_MESSAGE_FROM_SYSTEM
Definition: winbase.h:423
#define FORMAT_MESSAGE_ALLOCATE_BUFFER
Definition: winbase.h:419
int WINAPI MessageBoxW(_In_opt_ HWND hWnd, _In_opt_ LPCWSTR lpText, _In_opt_ LPCWSTR lpCaption, _In_ UINT uType)
#define MB_ICONERROR
Definition: winuser.h:787
#define MB_OK
Definition: winuser.h:790
#define MessageBox
Definition: winuser.h:5822
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by OnAutoSync(), and SetNTPServer().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  hinstDLL,
DWORD  dwReason,
LPVOID  lpReserved 
)

Definition at line 171 of file timedate.c.

174{
175 UNREFERENCED_PARAMETER(lpReserved);
176
177 switch (dwReason)
178 {
180 {
182
183 InitControls.dwSize = sizeof(INITCOMMONCONTROLSEX);
186
187 hApplet = hinstDLL;
188 }
189 break;
190 }
191
192 return TRUE;
193}
DWORD dwReason
Definition: misc.cpp:154
BOOL WINAPI InitCommonControlsEx(const INITCOMMONCONTROLSEX *lpInitCtrls)
Definition: commctrl.c:893
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
static VOID InitControls(HWND hwnd)
Definition: mplay32.c:303
struct tagINITCOMMONCONTROLSEX INITCOMMONCONTROLSEX
#define ICC_DATE_CLASSES
Definition: commctrl.h:67
#define ICC_PROGRESS_CLASS
Definition: commctrl.h:63
#define ICC_UPDOWN_CLASS
Definition: commctrl.h:62

◆ InitPropSheetPage()

static VOID InitPropSheetPage ( PROPSHEETPAGEW psp,
WORD  idDlg,
DLGPROC  DlgProc 
)
static

Definition at line 60 of file timedate.c.

61{
62 ZeroMemory(psp, sizeof(PROPSHEETPAGEW));
63 psp->dwSize = sizeof(PROPSHEETPAGEW);
64 psp->dwFlags = PSP_DEFAULT;
65 psp->hInstance = hApplet;
67 psp->pfnDlgProc = DlgProc;
68}
WORD idDlg
Definition: desk.c:121
DLGPROC DlgProc
Definition: desk.c:122
#define PSP_DEFAULT
Definition: prsht.h:22
struct _PROPSHEETPAGEW PROPSHEETPAGEW
DLGPROC pfnDlgProc
Definition: prsht.h:226
DWORD dwSize
Definition: prsht.h:214
DWORD dwFlags
Definition: prsht.h:215
LPCWSTR pszTemplate
Definition: prsht.h:218
HINSTANCE hInstance
Definition: prsht.h:216

Referenced by Applet().

◆ PropSheetProc()

static int CALLBACK PropSheetProc ( HWND  hwndDlg,
UINT  uMsg,
LPARAM  lParam 
)
static

Definition at line 71 of file timedate.c.

72{
73 // NOTE: This callback is needed to set large icon correctly.
75 switch (uMsg)
76 {
78 {
80 SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
81 break;
82 }
83 }
84 return 0;
85}
static HICON
Definition: imagelist.c:84
HICON hIcon
Definition: msconfig.c:44
#define PSCB_INITIALIZED
Definition: prsht.h:75
#define ICON_BIG
Definition: tnclass.cpp:51
LONG_PTR LPARAM
Definition: windef.h:208
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE hInstance, _In_ LPCWSTR lpIconName)
Definition: cursoricon.c:2075
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by Applet().

Variable Documentation

◆ Applets

APPLET Applets[NUM_APPLETS]
Initial value:
=
{
}
#define IDS_CPLDESCRIPTION
Definition: resource.h:9
static LONG APIENTRY Applet(HWND hwnd, UINT uMsg, LPARAM wParam, LPARAM lParam)
Definition: timedate.c:88

Definition at line 20 of file timedate.c.

Referenced by CPlApplet().

◆ hApplet

HINSTANCE hApplet

Definition at line 17 of file timedate.c.

Referenced by Applet(), DllMain(), InitPropSheetPage(), and PropSheetProc().