ReactOS 0.4.15-dev-8422-g6219a1a
timedate.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
#include <winreg.h>
#include <wingdi.h>
#include <winuser.h>
#include <wchar.h>
#include <commctrl.h>
#include <cpl.h>
#include <debug.h>
#include <strsafe.h>
#include "resource.h"
Include dependency graph for timedate.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  APPLET
 
struct  SYNC_STATUS
 
struct  _NMMCCSELCHANGE
 
struct  _NMMCCAUTOUPDATE
 

Macros

#define _INC_WINDOWS
 
#define COM_NO_WINDOWS_H
 
#define WIN32_NO_STATUS
 
#define MAX_KEY_LENGTH   255
 
#define MAX_VALUE_NAME   16383
 
#define SERVERLISTSIZE   6
 
#define BUFSIZE   1024
 
#define ID_TIMER   1
 
#define CLM_STOPCLOCK   (WM_USER + 1)
 
#define CLM_STARTCLOCK   (WM_USER + 2)
 
#define MCCM_SETDATE   (WM_USER + 1)
 
#define MCCM_GETDATE   (WM_USER + 2)
 
#define MCCM_RESET   (WM_USER + 3)
 
#define MCCM_CHANGED   (WM_USER + 4)
 
#define MCCN_SELCHANGE   (1)
 
#define MCCN_AUTOUPDATE   (2)
 

Typedefs

typedef struct APPLETPAPPLET
 
typedef struct SYNC_STATUSPSYNC_STATUS
 
typedef struct _NMMCCSELCHANGE NMMCCSELCHANGE
 
typedef struct _NMMCCSELCHANGEPNMMCCSELCHANGE
 
typedef struct _NMMCCAUTOUPDATE NMMCCAUTOUPDATE
 
typedef struct _NMMCCAUTOUPDATEPNMMCCAUTOUPDATE
 

Functions

INT_PTR CALLBACK DateTimePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL SystemSetLocalTime (LPSYSTEMTIME lpSystemTime)
 
INT_PTR CALLBACK TimeZonePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
INT_PTR CALLBACK InetTimePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
VOID DisplayWin32Error (DWORD dwErrorCode)
 
BOOL RegisterClockControl (VOID)
 
VOID UnregisterClockControl (VOID)
 
BOOL RegisterMonthCalControl (IN HINSTANCE hInstance)
 
VOID UnregisterMonthCalControl (IN HINSTANCE hInstance)
 

Variables

HINSTANCE hApplet
 

Macro Definition Documentation

◆ _INC_WINDOWS

#define _INC_WINDOWS

Definition at line 6 of file timedate.h.

◆ BUFSIZE

#define BUFSIZE   1024

Definition at line 27 of file timedate.h.

◆ CLM_STARTCLOCK

#define CLM_STARTCLOCK   (WM_USER + 2)

Definition at line 74 of file timedate.h.

◆ CLM_STOPCLOCK

#define CLM_STOPCLOCK   (WM_USER + 1)

Definition at line 73 of file timedate.h.

◆ COM_NO_WINDOWS_H

#define COM_NO_WINDOWS_H

Definition at line 7 of file timedate.h.

◆ ID_TIMER

#define ID_TIMER   1

Definition at line 28 of file timedate.h.

◆ MAX_KEY_LENGTH

#define MAX_KEY_LENGTH   255

Definition at line 24 of file timedate.h.

◆ MAX_VALUE_NAME

#define MAX_VALUE_NAME   16383

Definition at line 25 of file timedate.h.

◆ MCCM_CHANGED

#define MCCM_CHANGED   (WM_USER + 4)

Definition at line 84 of file timedate.h.

◆ MCCM_GETDATE

#define MCCM_GETDATE   (WM_USER + 2)

Definition at line 82 of file timedate.h.

◆ MCCM_RESET

#define MCCM_RESET   (WM_USER + 3)

Definition at line 83 of file timedate.h.

◆ MCCM_SETDATE

#define MCCM_SETDATE   (WM_USER + 1)

Definition at line 81 of file timedate.h.

◆ MCCN_AUTOUPDATE

#define MCCN_AUTOUPDATE   (2)

Definition at line 97 of file timedate.h.

◆ MCCN_SELCHANGE

#define MCCN_SELCHANGE   (1)

Definition at line 86 of file timedate.h.

◆ SERVERLISTSIZE

#define SERVERLISTSIZE   6

Definition at line 26 of file timedate.h.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 8 of file timedate.h.

Typedef Documentation

◆ NMMCCAUTOUPDATE

◆ NMMCCSELCHANGE

◆ PAPPLET

typedef struct APPLET * PAPPLET

◆ PNMMCCAUTOUPDATE

◆ PNMMCCSELCHANGE

◆ PSYNC_STATUS

Function Documentation

◆ DateTimePageProc()

INT_PTR CALLBACK DateTimePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 265 of file dateandtime.c.

269{
270 SYSTEMTIME st;
271 GetLocalTime(&st);
272
273 switch (uMsg)
274 {
275 case WM_INITDIALOG:
277 IDC_MONTHCB));
278
279 /* Set range and current year */
280 SendMessageW(GetDlgItem(hwndDlg, IDC_YEAR), UDM_SETRANGE, 0, MAKELONG ((short) 9999, (short) 1900));
281 SendMessageW(GetDlgItem(hwndDlg, IDC_YEAR), UDM_SETPOS, 0, MAKELONG( (short) st.wYear, 0));
282
284
285 SetTimer(hwndDlg, ID_TIMER, 1000 - st.wMilliseconds, NULL);
286 break;
287
288 case WM_TIMER:
290
291 // Reset timeout.
292 SetTimer(hwndDlg, ID_TIMER, 1000 - st.wMilliseconds, NULL);
293 break;
294
295 case WM_COMMAND:
296 switch (LOWORD(wParam))
297 {
298 case IDC_MONTHCB:
300 {
303 (WORD) -1,
305 (WORD) -1);
306 }
307 break;
308 }
309 break;
310
312 if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_YEARTEXT))
314 break;
315
316 case WM_NOTIFY:
317 {
318 LPNMHDR lpnm = (LPNMHDR)lParam;
319
320 switch (lpnm->idFrom)
321 {
322 case IDC_YEAR:
323 switch (lpnm->code)
324 {
325 case UDN_DELTAPOS:
326 {
327 SHORT wYear;
328 LPNMUPDOWN updown = (LPNMUPDOWN)lpnm;
329 wYear = (SHORT)SendMessageW(GetDlgItem(hwndDlg, IDC_YEAR), UDM_GETPOS, 0, 0);
330 /* Enable the 'Apply' button */
331 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
334 (WORD) -1,
335 (WORD) -1,
336 (WORD) (wYear + updown->iDelta));
337 }
338 break;
339 }
340 break;
341
342 case IDC_TIMEPICKER:
343 switch (lpnm->code)
344 {
346 /* Stop the timer */
347 KillTimer(hwndDlg, ID_TIMER);
348
349 /* Tell the clock to stop ticking */
351 0, 0);
352
353 // TODO: Set the clock to the input time.
354
355 /* Enable the 'Apply' button */
356 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
357 break;
358 }
359 break;
360
362 switch (lpnm->code)
363 {
364 case MCCN_SELCHANGE:
365 /* Enable the 'Apply' button */
366 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
367 break;
368
369 case MCCN_AUTOUPDATE:
370 AutoUpdateMonthCal(hwndDlg,
371 (PNMMCCAUTOUPDATE)lpnm);
372 break;
373 }
374 break;
375
376 default:
377 switch (lpnm->code)
378 {
379 case PSN_SETACTIVE:
380 SetTimeZoneName(hwndDlg);
381 break;
382
383 case PSN_APPLY:
384 SetLocalSystemTime(hwndDlg);
385
386 /* Tell the clock to start ticking */
388 0, 0);
389
390 SetTimer(hwndDlg, ID_TIMER, 1000 - st.wMilliseconds, NULL);
391 return TRUE;
392 }
393 break;
394 }
395 }
396 break;
397
398 case WM_TIMECHANGE:
399 /* FIXME: We don't get this message as we're not a top-level window... */
400 SendMessageW(GetDlgItem(hwndDlg,
403 0,
404 0);
405 break;
406
407 case WM_DESTROY:
408 KillTimer(hwndDlg, ID_TIMER);
409 break;
410 }
411
412 return FALSE;
413}
#define ID_TIMER
Definition: resource.h:23
WPARAM wParam
Definition: combotst.c:138
LPARAM lParam
Definition: combotst.c:139
static INT_PTR CALLBACK DTPProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: dateandtime.c:246
static WORD GetCBSelectedMonth(HWND hCombo)
Definition: dateandtime.c:195
static VOID SetLocalSystemTime(HWND hwnd)
Definition: dateandtime.c:76
static VOID SetTimeZoneName(HWND hwnd)
Definition: dateandtime.c:111
static VOID FillMonthsComboBox(HWND hCombo)
Definition: dateandtime.c:146
static WNDPROC pOldWndProc
Definition: dateandtime.c:14
static VOID AutoUpdateMonthCal(HWND hwndDlg, PNMMCCAUTOUPDATE lpAutoUpdate)
Definition: dateandtime.c:234
static VOID ChangeMonthCalDate(HWND hMonthCal, WORD Day, WORD Month, WORD Year)
Definition: dateandtime.c:220
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IDC_YEAR
Definition: resource.h:12
#define IDC_CLOCKWND
Definition: resource.h:9
#define IDC_MONTHCALENDAR
Definition: resource.h:8
#define IDC_MONTHCB
Definition: resource.h:6
#define IDC_YEARTEXT
Definition: resource.h:13
#define IDC_TIMEPICKER
Definition: resource.h:11
VOID WINAPI GetLocalTime(OUT LPSYSTEMTIME lpSystemTime)
Definition: time.c:286
unsigned short WORD
Definition: ntddk_ex.h:93
#define LOWORD(l)
Definition: pedump.c:82
short SHORT
Definition: pedump.c:59
#define PropSheet_Changed(d, w)
Definition: prsht.h:344
#define PSN_APPLY
Definition: prsht.h:117
#define PSN_SETACTIVE
Definition: prsht.h:115
#define UDM_SETPOS
Definition: commctrl.h:2143
#define UDM_SETRANGE
Definition: commctrl.h:2141
struct _NM_UPDOWN * LPNMUPDOWN
#define DTN_DATETIMECHANGE
Definition: commctrl.h:4366
#define DTM_SETSYSTEMTIME
Definition: commctrl.h:4331
#define GDT_VALID
Definition: commctrl.h:4460
#define UDM_GETPOS
Definition: commctrl.h:2144
#define UDN_DELTAPOS
Definition: commctrl.h:2169
#define WM_NOTIFY
Definition: richedit.h:61
int iDelta
Definition: commctrl.h:2166
WORD wYear
Definition: winbase.h:905
WORD wMilliseconds
Definition: winbase.h:912
UINT_PTR idFrom
Definition: winuser.h:3158
UINT code
Definition: winuser.h:3159
#define MCCN_AUTOUPDATE
Definition: timedate.h:97
#define CLM_STOPCLOCK
Definition: timedate.h:73
#define MCCN_SELCHANGE
Definition: timedate.h:86
#define CLM_STARTCLOCK
Definition: timedate.h:74
#define MCCM_RESET
Definition: timedate.h:83
#define LONG_PTR
Definition: treelist.c:79
#define GWLP_WNDPROC
Definition: treelist.c:66
int32_t INT_PTR
Definition: typedefs.h:64
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define HIWORD(l)
Definition: typedefs.h:247
LONG_PTR LPARAM
Definition: windef.h:208
#define WM_CTLCOLORSTATIC
Definition: winuser.h:1772
#define COLOR_WINDOW
Definition: winuser.h:918
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define WM_COMMAND
Definition: winuser.h:1740
#define WM_INITDIALOG
Definition: winuser.h:1739
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
#define CBN_SELCHANGE
Definition: winuser.h:1979
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define WM_TIMECHANGE
Definition: winuser.h:1634
#define WM_TIMER
Definition: winuser.h:1742
struct tagNMHDR * LPNMHDR
HWND WINAPI GetParent(_In_ HWND)
#define WM_DESTROY
Definition: winuser.h:1609
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
Definition: winuser.h:2906
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SetWindowLongPtrW
Definition: winuser.h:5355
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by Applet().

◆ 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}
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:5831
__wchar_t WCHAR
Definition: xmlstorage.h:180
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by OnAutoSync(), and SetNTPServer().

◆ InetTimePageProc()

INT_PTR CALLBACK InetTimePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 381 of file internettime.c.

385{
386 switch (uMsg)
387 {
388 case WM_INITDIALOG:
389 OnInitDialog(hwndDlg);
390 break;
391
392 case WM_COMMAND:
393 switch(LOWORD(wParam))
394 {
395 case IDC_UPDATEBUTTON:
396 OnUpdate(hwndDlg);
397 break;
398
399 case IDC_SERVERLIST:
401 {
402 /* Enable the 'Apply' button */
403 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
404 }
405 break;
406
407 case IDC_AUTOSYNC:
408 if (HIWORD(wParam) == BN_CLICKED)
409 {
410 EnableDialogText(hwndDlg);
411
412 /* Enable the 'Apply' button */
413 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
414 }
415 break;
416 }
417 break;
418
419 case WM_DESTROY:
420 break;
421
422 case WM_NOTIFY:
423 {
424 LPNMHDR lpnm = (LPNMHDR)lParam;
425
426 switch (lpnm->code)
427 {
428 case PSN_APPLY:
429 SetNTPServer(hwndDlg, FALSE);
430
433 else
435
436 return TRUE;
437
438 default:
439 break;
440 }
441 }
442 break;
443 }
444
445 return FALSE;
446}
#define IDC_UPDATEBUTTON
Definition: resource.h:23
#define IDC_AUTOSYNC
Definition: resource.h:24
#define IDC_SERVERLIST
Definition: resource.h:22
static VOID EnableDialogText(HWND hwnd)
Definition: internettime.c:175
static VOID OnAutoSync(BOOL Sync)
Definition: internettime.c:311
static VOID OnInitDialog(HWND hwnd)
Definition: internettime.c:301
static VOID OnUpdate(HWND hwndDlg)
Definition: internettime.c:364
static VOID SetNTPServer(HWND hwnd, BOOL bBeginUpdate)
Definition: internettime.c:93
#define BN_CLICKED
Definition: winuser.h:1925
#define BST_CHECKED
Definition: winuser.h:197
#define CBN_EDITCHANGE
Definition: winuser.h:1975
#define BM_GETCHECK
Definition: winuser.h:1918

Referenced by Applet().

◆ RegisterClockControl()

BOOL RegisterClockControl ( VOID  )

Definition at line 283 of file clock.c.

284{
285 WNDCLASSEXW wc = {0};
286
287 wc.cbSize = sizeof(WNDCLASSEXW);
289 wc.hInstance = hApplet;
291 wc.hbrBackground = (HBRUSH)(COLOR_BTNFACE + 1);
293
294 return RegisterClassExW(&wc) != (ATOM)0;
295}
WORD ATOM
Definition: dimm.idl:113
HINSTANCE hApplet
Definition: access.c:17
static const WCHAR szClockWndClass[]
Definition: clock.c:30
static LRESULT CALLBACK ClockWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
Definition: clock.c:135
LPCWSTR lpszClassName
Definition: winuser.h:3226
HBRUSH hbrBackground
Definition: winuser.h:3224
WNDPROC lpfnWndProc
Definition: winuser.h:3218
UINT cbSize
Definition: winuser.h:3216
HCURSOR hCursor
Definition: winuser.h:3223
HINSTANCE hInstance
Definition: winuser.h:3221
#define IDC_ARROW
Definition: winuser.h:687
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2149
ATOM WINAPI RegisterClassExW(_In_ CONST WNDCLASSEXW *)
struct _WNDCLASSEXW WNDCLASSEXW
#define COLOR_BTNFACE
Definition: winuser.h:928

Referenced by Applet().

◆ RegisterMonthCalControl()

BOOL RegisterMonthCalControl ( IN HINSTANCE  hInstance)

Definition at line 1097 of file monthcal.c.

1098{
1099 WNDCLASSW wc = {0};
1100
1101 wc.style = CS_DBLCLKS;
1103 wc.cbWndExtra = sizeof(PMONTHCALWND);
1104 wc.hInstance = hInstance;
1106 (LPWSTR)IDC_ARROW);
1107 wc.hbrBackground = (HBRUSH)(MONTHCAL_CTRLBG + 1);
1109
1110 return RegisterClassW(&wc) != 0;
1111}
HINSTANCE hInstance
Definition: charmap.c:19
struct _MONTHCALWND * PMONTHCALWND
#define MONTHCAL_CTRLBG
Definition: monthcal.c:18
static LRESULT CALLBACK MonthCalWndProc(IN HWND hwnd, IN UINT uMsg, IN WPARAM wParam, IN LPARAM lParam)
Definition: monthcal.c:683
static const WCHAR szMonthCalWndClass[]
Definition: monthcal.c:14
LPCWSTR lpszClassName
Definition: winuser.h:3185
HBRUSH hbrBackground
Definition: winuser.h:3183
HINSTANCE hInstance
Definition: winuser.h:3180
UINT style
Definition: winuser.h:3176
WNDPROC lpfnWndProc
Definition: winuser.h:3177
int cbWndExtra
Definition: winuser.h:3179
HCURSOR hCursor
Definition: winuser.h:3182
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define CS_DBLCLKS
Definition: winuser.h:651

Referenced by Applet().

◆ SystemSetLocalTime()

BOOL SystemSetLocalTime ( LPSYSTEMTIME  lpSystemTime)

Definition at line 17 of file dateandtime.c.

18{
19 HANDLE hToken;
20 DWORD PrevSize;
21 TOKEN_PRIVILEGES priv, previouspriv;
22 BOOL Ret = FALSE;
23
24 /*
25 * Enable the SeSystemtimePrivilege privilege
26 */
27
30 &hToken))
31 {
32 priv.PrivilegeCount = 1;
34
37 &priv.Privileges[0].Luid))
38 {
39 if (AdjustTokenPrivileges(hToken,
40 FALSE,
41 &priv,
42 sizeof(previouspriv),
43 &previouspriv,
44 &PrevSize) &&
46 {
47 /*
48 * We successfully enabled it, we're permitted to change the time.
49 * Call SetLocalTime twice to ensure correct results.
50 */
51 Ret = SetLocalTime(lpSystemTime) &&
52 SetLocalTime(lpSystemTime);
53
54 /*
55 * For the sake of security, restore the previous status again
56 */
57 if (previouspriv.PrivilegeCount > 0)
58 {
60 FALSE,
61 &previouspriv,
62 0,
63 NULL,
64 0);
65 }
66 }
67 }
68 CloseHandle(hToken);
69 }
70
71 return Ret;
72}
#define ERROR_SUCCESS
Definition: deptool.c:10
BOOL WINAPI LookupPrivilegeValueW(LPCWSTR lpSystemName, LPCWSTR lpPrivilegeName, PLUID lpLuid)
Definition: misc.c:782
BOOL WINAPI AdjustTokenPrivileges(HANDLE TokenHandle, BOOL DisableAllPrivileges, PTOKEN_PRIVILEGES NewState, DWORD BufferLength, PTOKEN_PRIVILEGES PreviousState, PDWORD ReturnLength)
Definition: security.c:374
BOOL WINAPI OpenProcessToken(HANDLE ProcessHandle, DWORD DesiredAccess, PHANDLE TokenHandle)
Definition: security.c:294
#define CloseHandle
Definition: compat.h:739
#define GetCurrentProcess()
Definition: compat.h:759
BOOL WINAPI SetLocalTime(IN CONST SYSTEMTIME *lpSystemTime)
Definition: time.c:356
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
$ULONG PrivilegeCount
Definition: setypes.h:1023
LUID_AND_ATTRIBUTES Privileges[ANYSIZE_ARRAY]
Definition: setypes.h:1024
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define SE_SYSTEMTIME_NAME
Definition: winnt_old.h:377
#define TOKEN_ADJUST_PRIVILEGES
Definition: setypes.h:930
#define TOKEN_QUERY
Definition: setypes.h:928
#define SE_PRIVILEGE_ENABLED
Definition: setypes.h:63

Referenced by SetLocalSystemTime().

◆ TimeZonePageProc()

INT_PTR CALLBACK TimeZonePageProc ( HWND  hwndDlg,
UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam 
)

Definition at line 272 of file timezone.c.

276{
278
279 switch (uMsg)
280 {
281 case WM_INITDIALOG:
282 {
285
288
290 if (hBitmap != NULL)
291 {
292 GetObjectW(hBitmap, sizeof(bitmap), &bitmap);
293
294 cxSource = bitmap.bmWidth;
295 cySource = bitmap.bmHeight;
296 }
297 break;
298 }
299
300 case WM_DRAWITEM:
301 {
302 LPDRAWITEMSTRUCT lpDrawItem;
303 lpDrawItem = (LPDRAWITEMSTRUCT)lParam;
304 if(lpDrawItem->CtlID == IDC_WORLD_BACKGROUND)
305 {
306 HDC hdcMem;
307 hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
308 if (hdcMem != NULL)
309 {
311 StretchBlt(lpDrawItem->hDC, lpDrawItem->rcItem.left, lpDrawItem->rcItem.top,
312 lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
313 lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
316 }
317 }
318 }
319 break;
320
321 case WM_COMMAND:
324 {
325 /* Enable the 'Apply' button */
326 PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
327 }
328 break;
329
330 case WM_DESTROY:
333 break;
334
335 case WM_NOTIFY:
336 {
337 LPNMHDR lpnm = (LPNMHDR)lParam;
338
339 switch (lpnm->code)
340 {
341 case PSN_APPLY:
342 {
344 BM_GETCHECK, 0, 0) != BST_UNCHECKED);
347 return TRUE;
348 }
349
350 default:
351 break;
352 }
353 }
354 break;
355 }
356
357 return FALSE;
358}
#define IDC_WORLD_BACKGROUND
Definition: resource.h:18
#define IDC_TIMEZONELIST
Definition: resource.h:16
#define IDC_WORLD
Definition: resource.h:19
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
static VOID CreateTimeZoneList(VOID)
Definition: timezone.c:139
static VOID SetLocalTimeZone(HWND hwnd)
Definition: timezone.c:226
static int cySource
Definition: timezone.c:27
static int cxSource
Definition: timezone.c:27
static HBITMAP hBitmap
Definition: timezone.c:26
static VOID DestroyTimeZoneList(VOID)
Definition: timezone.c:145
static VOID ShowTimeZoneList(HWND hwnd)
Definition: timezone.c:167
pKey DeleteObject()
static HDC
Definition: imagelist.c:92
#define PSNRET_NOERROR
Definition: prsht.h:129
Definition: bl.h:1331
Definition: uimain.c:89
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define SetWindowLongPtr
Definition: treelist.c:70
VOID SetAutoDaylight(IN BOOL EnableAutoDaylightTime)
Definition: tzlib.c:323
BOOL GetAutoDaylight(VOID)
Definition: tzlib.c:283
HDC hdcMem
Definition: welcome.c:104
UINT_PTR WPARAM
Definition: windef.h:207
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI DeleteDC(_In_ HDC)
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define IMAGE_BITMAP
Definition: winuser.h:211
#define BST_UNCHECKED
Definition: winuser.h:199
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE hInst, _In_ LPCWSTR name, _In_ UINT type, _In_ int cx, _In_ int cy, _In_ UINT fuLoad)
Definition: cursoricon.c:2247
#define WM_DRAWITEM
Definition: winuser.h:1645
#define BM_SETCHECK
Definition: winuser.h:1921
#define DWLP_MSGRESULT
Definition: winuser.h:870
#define LR_DEFAULTCOLOR
Definition: winuser.h:1087
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define SendDlgItemMessage
Definition: winuser.h:5851

Referenced by Applet().

◆ UnregisterClockControl()

VOID UnregisterClockControl ( VOID  )

Definition at line 299 of file clock.c.

300{
302 hApplet);
303}
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

Referenced by Applet().

◆ UnregisterMonthCalControl()

VOID UnregisterMonthCalControl ( IN HINSTANCE  hInstance)

Definition at line 1114 of file monthcal.c.

1115{
1117 hInstance);
1118}

Referenced by Applet().

Variable Documentation

◆ hApplet

HINSTANCE hApplet
extern

Definition at line 17 of file access.c.