Author: ekohl
Date: Sun Apr 23 21:56:36 2017
New Revision: 74396
URL:
http://svn.reactos.org/svn/reactos?rev=74396&view=rev
Log:
[SYSETUP]
Update the shown date and time on the Date and Time page until the user changes the date
or time.
CORE-11896
Modified:
trunk/reactos/dll/win32/syssetup/wizard.c
Modified: trunk/reactos/dll/win32/syssetup/wizard.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/syssetup/wizard.…
==============================================================================
--- trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/syssetup/wizard.c [iso-8859-1] Sun Apr 23 21:56:36 2017
@@ -1476,11 +1476,24 @@
return Ret;
}
+
+static VOID
+UpdateLocalSystemTime(HWND hwnd)
+{
+ SYSTEMTIME LocalTime;
+
+ GetLocalTime(&LocalTime);
+ DateTime_SetSystemtime(GetDlgItem(hwnd, IDC_DATEPICKER), GDT_VALID, &LocalTime);
+ DateTime_SetSystemtime(GetDlgItem(hwnd, IDC_TIMEPICKER), GDT_VALID, &LocalTime);
+}
+
+
static BOOL
WriteDateTimeSettings(HWND hwndDlg, PSETUPDATA SetupData)
{
WCHAR Title[64];
WCHAR ErrorLocalTime[256];
+
GetLocalSystemTime(hwndDlg, SetupData);
SetLocalTimeZone(GetDlgItem(hwndDlg, IDC_TIMEZONELIST),
SetupData);
@@ -1503,6 +1516,7 @@
return TRUE;
}
+
static INT_PTR CALLBACK
DateTimePageDlgProc(HWND hwndDlg,
@@ -1518,7 +1532,6 @@
switch (uMsg)
{
case WM_INITDIALOG:
- {
/* Save pointer to the global setup data */
SetupData = (PSETUPDATA)((LPPROPSHEETPAGE)lParam)->lParam;
SetWindowLongPtr(hwndDlg, GWL_USERDATA, (DWORD_PTR)SetupData);
@@ -1542,16 +1555,14 @@
SendDlgItemMessage(hwndDlg, IDC_AUTODAYLIGHT, BM_SETCHECK,
(WPARAM)BST_CHECKED, 0);
}
-
- }
- break;
-
+ break;
+
+ case WM_TIMER:
+ UpdateLocalSystemTime(hwndDlg);
+ break;
case WM_NOTIFY:
- {
- LPNMHDR lpnm = (LPNMHDR)lParam;
-
- switch (lpnm->code)
+ switch (((LPNMHDR)lParam)->code)
{
case PSN_SETACTIVE:
/* Enable the Back and Next buttons */
@@ -1561,13 +1572,17 @@
SetWindowLongPtr(hwndDlg, DWL_MSGRESULT,
SetupData->uFirstNetworkWizardPage);
return TRUE;
}
+ SetTimer(hwndDlg, 1, 1000, NULL);
+ break;
+
+ case PSN_KILLACTIVE:
+ case DTN_DATETIMECHANGE:
+ KillTimer(hwndDlg, 1);
break;
case PSN_WIZNEXT:
- {
WriteDateTimeSettings(hwndDlg, SetupData);
- }
- break;
+ break;
case PSN_WIZBACK:
SetupData->UnattendSetup = FALSE;
@@ -1576,8 +1591,7 @@
default:
break;
}
- }
- break;
+ break;
case WM_DESTROY:
DestroyTimeZoneList(SetupData);