ReactOS  0.4.14-dev-608-gd495a4f
timezone.c File Reference
#include "timedate.h"
Include dependency graph for timezone.c:

Go to the source code of this file.

Classes

struct  _TZ_INFO
 
struct  _TIMEZONE_ENTRY
 

Typedefs

typedef struct _TZ_INFO TZ_INFO
 
typedef struct _TZ_INFOPTZ_INFO
 
typedef struct _TIMEZONE_ENTRY TIMEZONE_ENTRY
 
typedef struct _TIMEZONE_ENTRYPTIMEZONE_ENTRY
 

Functions

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry (LONG Bias, LPWSTR lpDescription)
 
static LONG QueryTimezoneData (HKEY hZoneKey, PTIMEZONE_ENTRY Entry)
 
static VOID CreateTimeZoneList (VOID)
 
static VOID DestroyTimeZoneList (VOID)
 
static VOID ShowTimeZoneList (HWND hwnd)
 
static VOID SetLocalTimeZone (HWND hwnd)
 
static VOID GetAutoDaylightInfo (HWND hwnd)
 
static VOID SetAutoDaylightInfo (HWND hwnd)
 
INT_PTR CALLBACK TimeZonePageProc (HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
 

Variables

static HBITMAP hBitmap = NULL
 
static int cxSource
 
static int cySource
 
PTIMEZONE_ENTRY TimeZoneListHead = NULL
 
PTIMEZONE_ENTRY TimeZoneListTail = NULL
 

Typedef Documentation

◆ PTIMEZONE_ENTRY

◆ PTZ_INFO

◆ TIMEZONE_ENTRY

◆ TZ_INFO

Function Documentation

◆ CreateTimeZoneList()

static VOID CreateTimeZoneList ( VOID  )
static

Definition at line 119 of file timezone.c.

120 {
121  WCHAR szKeyName[256];
122  DWORD dwIndex;
123  DWORD dwNameSize;
124  LONG lError;
125  HKEY hZonesKey;
126  HKEY hZoneKey;
128  PTIMEZONE_ENTRY Current;
129 
131  L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
132  0,
134  &hZonesKey))
135  return;
136 
137  for (dwIndex = 0; ; dwIndex++)
138  {
139  dwNameSize = sizeof(szKeyName);
140  lError = RegEnumKeyExW(hZonesKey,
141  dwIndex,
142  szKeyName,
143  &dwNameSize,
144  NULL,
145  NULL,
146  NULL,
147  NULL);
148  if (lError == ERROR_NO_MORE_ITEMS)
149  break;
150 
151  if (RegOpenKeyEx (hZonesKey,
152  szKeyName,
153  0,
155  &hZoneKey))
156  break;
157 
159  if (Entry == NULL)
160  {
161  RegCloseKey(hZoneKey);
162  break;
163  }
164 
165  lError = QueryTimezoneData(hZoneKey,
166  Entry);
167 
168  RegCloseKey(hZoneKey);
169 
170  if (lError != ERROR_SUCCESS)
171  {
173  break;
174  }
175 
176  if (TimeZoneListHead == NULL &&
178  {
179  Entry->Prev = NULL;
180  Entry->Next = NULL;
183  }
184  else
185  {
186  Current = GetLargerTimeZoneEntry(Entry->TimezoneInfo.Bias, Entry->Description);
187  if (Current != NULL)
188  {
189  if (Current == TimeZoneListHead)
190  {
191  /* Prepend to head */
192  Entry->Prev = NULL;
193  Entry->Next = TimeZoneListHead;
196  }
197  else
198  {
199  /* Insert before current */
200  Entry->Prev = Current->Prev;
201  Entry->Next = Current;
202  Current->Prev->Next = Entry;
203  Current->Prev = Entry;
204  }
205  }
206  else
207  {
208  /* Append to tail */
209  Entry->Prev = TimeZoneListTail;
210  Entry->Next = NULL;
213  }
214  }
215  }
216 
217  RegCloseKey(hZonesKey);
218 }
#define ERROR_SUCCESS
Definition: deptool.c:10
struct _Entry Entry
Definition: kefuncs.h:640
#define ERROR_NO_MORE_ITEMS
Definition: compat.h:95
PTIMEZONE_ENTRY TimeZoneListHead
Definition: timezone.c:38
Definition: timezone.c:24
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
long LONG
Definition: pedump.c:60
static PTIMEZONE_ENTRY GetLargerTimeZoneEntry(LONG Bias, LPWSTR lpDescription)
Definition: timezone.c:43
smooth NULL
Definition: ftsmooth.c:416
static LONG QueryTimezoneData(HKEY hZoneKey, PTIMEZONE_ENTRY Entry)
Definition: timezone.c:70
PTIMEZONE_ENTRY TimeZoneListTail
Definition: timezone.c:39
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
__wchar_t WCHAR
Definition: xmlstorage.h:180
unsigned long DWORD
Definition: ntddk_ex.h:95
HRESULT Next([in] ULONG celt, [out, size_is(celt), length_is(*pceltFetched)] STATPROPSETSTG *rgelt, [out] ULONG *pceltFetched)
static const WCHAR L[]
Definition: oid.c:1250
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:26
#define RegOpenKeyEx
Definition: winreg.h:520
struct _TIMEZONE_ENTRY * Next
Definition: timezone.c:27
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
LONG WINAPI RegEnumKeyExW(_In_ HKEY hKey, _In_ DWORD dwIndex, _Out_ LPWSTR lpName, _Inout_ LPDWORD lpcbName, _Reserved_ LPDWORD lpReserved, _Out_opt_ LPWSTR lpClass, _Inout_opt_ LPDWORD lpcbClass, _Out_opt_ PFILETIME lpftLastWriteTime)
Definition: reg.c:2527
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12
#define KEY_ENUMERATE_SUB_KEYS
Definition: nt_native.h:1019

Referenced by TimeZonePageProc().

◆ DestroyTimeZoneList()

static VOID DestroyTimeZoneList ( VOID  )
static

Definition at line 222 of file timezone.c.

223 {
225 
226  while (TimeZoneListHead != NULL)
227  {
229 
230  TimeZoneListHead = Entry->Next;
231  if (TimeZoneListHead != NULL)
232  {
234  }
235 
237  }
238 
240 }
struct _Entry Entry
Definition: kefuncs.h:640
PTIMEZONE_ENTRY TimeZoneListHead
Definition: timezone.c:38
Definition: timezone.c:24
smooth NULL
Definition: ftsmooth.c:416
PTIMEZONE_ENTRY TimeZoneListTail
Definition: timezone.c:39
#define GetProcessHeap()
Definition: compat.h:403
struct _TIMEZONE_ENTRY * Prev
Definition: timezone.c:26
#define HeapFree(x, y, z)
Definition: compat.h:402
base of all file and directory entries
Definition: entries.h:82

Referenced by TimeZonePageProc().

◆ GetAutoDaylightInfo()

static VOID GetAutoDaylightInfo ( HWND  hwnd)
static

Definition at line 323 of file timezone.c.

324 {
325  HKEY hKey;
326 
328  L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
329  0,
331  &hKey))
332  return;
333 
334  /* If the call fails (non zero), the reg value isn't available,
335  * which means it shouldn't be disabled, so we should check the button.
336  */
337  if (RegQueryValueExW(hKey,
338  L"DisableAutoDaylightTimeSet",
339  NULL,
340  NULL,
341  NULL,
342  NULL))
343  {
345  }
346  else
347  {
349  }
350 
351  RegCloseKey(hKey);
352 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
UINT_PTR WPARAM
Definition: windef.h:207
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
smooth NULL
Definition: ftsmooth.c:416
#define BM_SETCHECK
Definition: winuser.h:1903
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
static const WCHAR L[]
Definition: oid.c:1250
#define BST_UNCHECKED
Definition: winuser.h:199
#define KEY_QUERY_VALUE
Definition: nt_native.h:1016
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BST_CHECKED
Definition: winuser.h:197
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by TimeZonePageProc().

◆ GetLargerTimeZoneEntry()

static PTIMEZONE_ENTRY GetLargerTimeZoneEntry ( LONG  Bias,
LPWSTR  lpDescription 
)
static

Definition at line 43 of file timezone.c.

46 {
48 
50  while (Entry != NULL)
51  {
52  if (Entry->TimezoneInfo.Bias < Bias)
53  return Entry;
54 
55  if (Entry->TimezoneInfo.Bias == Bias)
56  {
57  if (_wcsicmp(Entry->Description, lpDescription) > 0)
58  return Entry;
59  }
60 
61  Entry = Entry->Next;
62  }
63 
64  return NULL;
65 }
struct _Entry Entry
Definition: kefuncs.h:640
PTIMEZONE_ENTRY TimeZoneListHead
Definition: timezone.c:38
Definition: timezone.c:24
smooth NULL
Definition: ftsmooth.c:416
base of all file and directory entries
Definition: entries.h:82
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)

Referenced by CreateTimeZoneList().

◆ QueryTimezoneData()

static LONG QueryTimezoneData ( HKEY  hZoneKey,
PTIMEZONE_ENTRY  Entry 
)
static

Definition at line 70 of file timezone.c.

73 {
74  DWORD dwValueSize;
75  LONG lError;
76 
77  dwValueSize = sizeof(Entry->Description);
78  lError = RegQueryValueExW(hZoneKey,
79  L"Display",
80  NULL,
81  NULL,
82  (LPBYTE)&Entry->Description,
83  &dwValueSize);
84  if (lError != ERROR_SUCCESS)
85  return lError;
86 
87  dwValueSize = sizeof(Entry->StandardName);
88  lError = RegQueryValueExW(hZoneKey,
89  L"Std",
90  NULL,
91  NULL,
92  (LPBYTE)&Entry->StandardName,
93  &dwValueSize);
94  if (lError != ERROR_SUCCESS)
95  return lError;
96 
97  dwValueSize = sizeof(Entry->DaylightName);
98  lError = RegQueryValueExW(hZoneKey,
99  L"Dlt",
100  NULL,
101  NULL,
102  (LPBYTE)&Entry->DaylightName,
103  &dwValueSize);
104  if (lError != ERROR_SUCCESS)
105  return lError;
106 
107  dwValueSize = sizeof(Entry->TimezoneInfo);
108  lError = RegQueryValueExW(hZoneKey,
109  L"TZI",
110  NULL,
111  NULL,
112  (LPBYTE)&Entry->TimezoneInfo,
113  &dwValueSize);
114  return lError;
115 }
#define ERROR_SUCCESS
Definition: deptool.c:10
unsigned char * LPBYTE
Definition: typedefs.h:52
long LONG
Definition: pedump.c:60
smooth NULL
Definition: ftsmooth.c:416
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
base of all file and directory entries
Definition: entries.h:82

Referenced by CreateTimeZoneList().

◆ SetAutoDaylightInfo()

static VOID SetAutoDaylightInfo ( HWND  hwnd)
static

Definition at line 356 of file timezone.c.

357 {
358  HKEY hKey;
359  DWORD dwValue = 1;
360 
362  L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
363  0,
365  &hKey))
366  return;
367 
369  {
370  RegSetValueExW(hKey,
371  L"DisableAutoDaylightTimeSet",
372  0,
373  REG_DWORD,
374  (LPBYTE)&dwValue,
375  sizeof(dwValue));
376  }
377  else
378  {
379  RegDeleteValueW(hKey,
380  L"DisableAutoDaylightTimeSet");
381  }
382 
383  RegCloseKey(hKey);
384 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define KEY_SET_VALUE
Definition: nt_native.h:1017
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:52
#define BM_GETCHECK
Definition: winuser.h:1900
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
Definition: reg.c:4895
unsigned long DWORD
Definition: ntddk_ex.h:95
static const WCHAR L[]
Definition: oid.c:1250
#define BST_UNCHECKED
Definition: winuser.h:199
LONG WINAPI RegDeleteValueW(HKEY hKey, LPCWSTR lpValueName)
Definition: reg.c:2355
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
#define REG_DWORD
Definition: sdbapi.c:596
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by TimeZonePageProc().

◆ SetLocalTimeZone()

static VOID SetLocalTimeZone ( HWND  hwnd)
static

Definition at line 278 of file timezone.c.

279 {
280  TIME_ZONE_INFORMATION TimeZoneInformation;
282  DWORD dwIndex;
283  DWORD i;
284 
285  dwIndex = (DWORD)SendMessageW(hwnd,
286  CB_GETCURSEL,
287  0,
288  0);
289 
290  i = 0;
292  while (i < dwIndex)
293  {
294  if (Entry == NULL)
295  return;
296 
297  i++;
298  Entry = Entry->Next;
299  }
300 
301  wcscpy(TimeZoneInformation.StandardName,
302  Entry->StandardName);
303  wcscpy(TimeZoneInformation.DaylightName,
304  Entry->DaylightName);
305 
306  TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
307  TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
308  TimeZoneInformation.DaylightBias = Entry->TimezoneInfo.DaylightBias;
309 
310  memcpy(&TimeZoneInformation.StandardDate,
311  &Entry->TimezoneInfo.StandardDate,
312  sizeof(SYSTEMTIME));
313  memcpy(&TimeZoneInformation.DaylightDate,
314  &Entry->TimezoneInfo.DaylightDate,
315  sizeof(SYSTEMTIME));
316 
317  /* Set time zone information */
318  SetTimeZoneInformation(&TimeZoneInformation);
319 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
struct _Entry Entry
Definition: kefuncs.h:640
PTIMEZONE_ENTRY TimeZoneListHead
Definition: timezone.c:38
Definition: timezone.c:24
#define DWORD
Definition: nt_native.h:44
#define CB_GETCURSEL
Definition: winuser.h:1925
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
smooth NULL
Definition: ftsmooth.c:416
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
BOOL WINAPI SetTimeZoneInformation(CONST TIME_ZONE_INFORMATION *lpTimeZoneInformation)
Definition: timezone.c:316
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
SYSTEMTIME StandardDate
Definition: winbase.h:1168
WCHAR DaylightName[32]
Definition: winbase.h:1170
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR StandardName[32]
Definition: winbase.h:1167
base of all file and directory entries
Definition: entries.h:82
SYSTEMTIME DaylightDate
Definition: winbase.h:1171

Referenced by TimeZonePageProc().

◆ ShowTimeZoneList()

static VOID ShowTimeZoneList ( HWND  hwnd)
static

Definition at line 244 of file timezone.c.

245 {
246  TIME_ZONE_INFORMATION TimeZoneInfo;
248  DWORD dwIndex;
249  DWORD i;
250 
251  GetTimeZoneInformation(&TimeZoneInfo);
252 
253  dwIndex = 0;
254  i = 0;
256  while (Entry != NULL)
257  {
259  CB_ADDSTRING,
260  0,
261  (LPARAM)Entry->Description);
262 
263  if (!wcscmp(Entry->StandardName, TimeZoneInfo.StandardName))
264  dwIndex = i;
265 
266  i++;
267  Entry = Entry->Next;
268  }
269 
271  CB_SETCURSEL,
272  (WPARAM)dwIndex,
273  0);
274 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
DWORD WINAPI GetTimeZoneInformation(LPTIME_ZONE_INFORMATION lpTimeZoneInformation)
Definition: timezone.c:262
struct _Entry Entry
Definition: kefuncs.h:640
PTIMEZONE_ENTRY TimeZoneListHead
Definition: timezone.c:38
Definition: timezone.c:24
UINT_PTR WPARAM
Definition: windef.h:207
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
#define CB_ADDSTRING
Definition: winuser.h:1918
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
unsigned long DWORD
Definition: ntddk_ex.h:95
#define CB_SETCURSEL
Definition: winuser.h:1943
_Check_return_ _CRTIMP int __cdecl wcscmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
WCHAR StandardName[32]
Definition: winbase.h:1167
base of all file and directory entries
Definition: entries.h:82

Referenced by TimeZonePageProc().

◆ TimeZonePageProc()

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

Definition at line 389 of file timezone.c.

393 {
394  BITMAP bitmap;
395 
396  switch (uMsg)
397  {
398  case WM_INITDIALOG:
403  if (hBitmap != NULL)
404  {
405  GetObjectW(hBitmap, sizeof(bitmap), &bitmap);
406 
407  cxSource = bitmap.bmWidth;
408  cySource = bitmap.bmHeight;
409  }
410  break;
411 
412  case WM_DRAWITEM:
413  {
414  LPDRAWITEMSTRUCT lpDrawItem;
415  lpDrawItem = (LPDRAWITEMSTRUCT) lParam;
416  if(lpDrawItem->CtlID == IDC_WORLD_BACKGROUND)
417  {
418  HDC hdcMem;
419  hdcMem = CreateCompatibleDC(lpDrawItem->hDC);
420  if (hdcMem != NULL)
421  {
423  StretchBlt(lpDrawItem->hDC, lpDrawItem->rcItem.left, lpDrawItem->rcItem.top,
424  lpDrawItem->rcItem.right - lpDrawItem->rcItem.left,
425  lpDrawItem->rcItem.bottom - lpDrawItem->rcItem.top,
426  hdcMem, 0, 0, cxSource, cySource, SRCCOPY);
427  DeleteDC(hdcMem);
428  }
429  }
430  }
431  break;
432 
433  case WM_COMMAND:
436  {
437  /* Enable the 'Apply' button */
438  PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
439  }
440  break;
441 
442  case WM_DESTROY:
445  break;
446 
447  case WM_NOTIFY:
448  {
449  LPNMHDR lpnm = (LPNMHDR)lParam;
450 
451  switch (lpnm->code)
452  {
453  case PSN_APPLY:
454  {
458  return TRUE;
459  }
460 
461  default:
462  break;
463  }
464  }
465  break;
466  }
467 
468  return FALSE;
469 }
#define TRUE
Definition: types.h:120
struct tagDRAWITEMSTRUCT * LPDRAWITEMSTRUCT
#define IDC_TIMEZONELIST
Definition: resource.h:16
static HDC
Definition: imagelist.c:92
LONG top
Definition: windef.h:307
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1497
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
HINSTANCE hApplet
Definition: access.c:17
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define PSN_APPLY
Definition: prsht.h:117
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define SetWindowLongPtr
Definition: treelist.c:70
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)
WPARAM wParam
Definition: combotst.c:138
#define DWLP_MSGRESULT
Definition: winuser.h:864
struct tagNMHDR * LPNMHDR
static VOID SetAutoDaylightInfo(HWND hwnd)
Definition: timezone.c:356
UINT code
Definition: winuser.h:3134
#define IDC_AUTODAYLIGHT
Definition: resource.h:17
static VOID ShowTimeZoneList(HWND hwnd)
Definition: timezone.c:244
HANDLE WINAPI LoadImageW(_In_opt_ HINSTANCE, _In_ LPCWSTR, _In_ UINT, _In_ int, _In_ int, _In_ UINT)
Definition: cursoricon.c:2172
smooth NULL
Definition: ftsmooth.c:416
#define WM_DESTROY
Definition: winuser.h:1591
static int cxSource
Definition: timezone.c:36
Definition: uimain.c:88
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define PropSheet_Changed(d, w)
Definition: prsht.h:326
#define BN_CLICKED
Definition: winuser.h:1907
#define IDC_WORLD_BACKGROUND
Definition: resource.h:18
#define IDC_WORLD
Definition: resource.h:19
#define PSNRET_NOERROR
Definition: prsht.h:129
#define WM_COMMAND
Definition: winuser.h:1722
static VOID DestroyTimeZoneList(VOID)
Definition: timezone.c:222
int WINAPI GetObjectW(_In_ HANDLE h, _In_ int c, _Out_writes_bytes_opt_(c) LPVOID pv)
HWND WINAPI GetParent(_In_ HWND)
static VOID CreateTimeZoneList(VOID)
Definition: timezone.c:119
static int cySource
Definition: timezone.c:36
BOOL WINAPI DeleteDC(_In_ HDC)
Definition: bl.h:1331
#define IMAGE_BITMAP
Definition: winuser.h:211
#define CBN_SELCHANGE
Definition: winuser.h:1961
static VOID SetLocalTimeZone(HWND hwnd)
Definition: timezone.c:278
#define WM_DRAWITEM
Definition: winuser.h:1627
static VOID GetAutoDaylightInfo(HWND hwnd)
Definition: timezone.c:323
#define HIWORD(l)
Definition: typedefs.h:246
LONG bottom
Definition: windef.h:309
static HBITMAP bitmap
Definition: clipboard.c:1344
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define LR_DEFAULTCOLOR
Definition: winuser.h:1077
#define WM_INITDIALOG
Definition: winuser.h:1721
static HBITMAP hBitmap
Definition: timezone.c:35
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
#define SRCCOPY
Definition: wingdi.h:332
HDC hdcMem
Definition: welcome.c:104
#define WM_NOTIFY
Definition: richedit.h:61

Referenced by Applet().

Variable Documentation

◆ cxSource

int cxSource
static

Definition at line 36 of file timezone.c.

Referenced by TimeZonePageProc().

◆ cySource

int cySource
static

Definition at line 36 of file timezone.c.

Referenced by TimeZonePageProc().

◆ hBitmap

◆ TimeZoneListHead

◆ TimeZoneListTail

PTIMEZONE_ENTRY TimeZoneListTail = NULL

Definition at line 39 of file timezone.c.

Referenced by CreateTimeZoneList(), and DestroyTimeZoneList().