Select current time zone on the time zone property page.

svn path=/trunk/; revision=11597
This commit is contained in:
Eric Kohl 2004-11-08 10:33:08 +00:00
parent d63d756d2c
commit 2f3caac348

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/ */
/* $Id: timedate.c,v 1.2 2004/11/07 16:03:51 ekohl Exp $ /* $Id: timedate.c,v 1.3 2004/11/08 10:33:08 ekohl Exp $
* *
* PROJECT: ReactOS Timedate Control Panel * PROJECT: ReactOS Timedate Control Panel
* FILE: lib/cpl/timedate/timedate.c * FILE: lib/cpl/timedate/timedate.c
@ -90,6 +90,25 @@ DateTimePageProc(HWND hwndDlg,
SendDlgItemMessageW(hwndDlg, IDC_TIMEZONE, WM_SETTEXT, 0, (LPARAM)TimeZoneInfo.StandardName); SendDlgItemMessageW(hwndDlg, IDC_TIMEZONE, WM_SETTEXT, 0, (LPARAM)TimeZoneInfo.StandardName);
} }
break; break;
case WM_NOTIFY:
{
LPNMHDR lpnm = (LPNMHDR)lParam;
switch (lpnm->code)
{
case DTN_DATETIMECHANGE:
case MCN_SELECT:
/* Enable the 'Apply' button */
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
break;
default:
break;
}
}
break;
} }
return FALSE; return FALSE;
@ -298,8 +317,15 @@ DestroyTimeZoneList(VOID)
static VOID static VOID
ShowTimeZoneList(HWND hwnd) ShowTimeZoneList(HWND hwnd)
{ {
TIME_ZONE_INFORMATION TimeZoneInfo;
PTIMEZONE_ENTRY Entry; PTIMEZONE_ENTRY Entry;
DWORD dwIndex;
DWORD i;
GetTimeZoneInformation(&TimeZoneInfo);
dwIndex = 0;
i = 0;
Entry = TimeZoneListHead; Entry = TimeZoneListHead;
while (Entry != NULL) while (Entry != NULL)
{ {
@ -308,13 +334,16 @@ ShowTimeZoneList(HWND hwnd)
0, 0,
(LPARAM)Entry->Description); (LPARAM)Entry->Description);
if (!wcscmp(Entry->StandardName, TimeZoneInfo.StandardName))
dwIndex = i;
i++;
Entry = Entry->Next; Entry = Entry->Next;
} }
SendMessageW(hwnd, SendMessageW(hwnd,
CB_SETCURSEL, CB_SETCURSEL,
(WPARAM)0, // index (WPARAM)dwIndex,
0); 0);
} }