mirror of
https://github.com/reactos/reactos.git
synced 2024-07-05 12:15:46 +00:00
- Fix indentation and coding style.
- Fix the Unicode-only code. - No code changes. svn path=/trunk/; revision=27055
This commit is contained in:
parent
f807c0daab
commit
e86c5c5ce0
|
@ -98,7 +98,7 @@ SetLocalSystemTime(HWND hwnd)
|
|||
(WPARAM)&Time,
|
||||
0);
|
||||
|
||||
/* broadcast the time change message */
|
||||
/* Broadcast the time change message */
|
||||
SendMessage(HWND_BROADCAST,
|
||||
WM_TIMECHANGE,
|
||||
0,
|
||||
|
@ -254,13 +254,10 @@ DTPProc(HWND hwnd,
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_KEYDOWN:
|
||||
{
|
||||
/* stop the timer when the user is about to change the time */
|
||||
if ((wParam != VK_LEFT) & (wParam != VK_RIGHT))
|
||||
KillTimer(GetParent(hwnd), ID_TIMER);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return CallWindowProc(pOldWndProc, hwnd, uMsg, wParam, lParam);
|
||||
|
@ -279,7 +276,6 @@ DateTimePageProc(HWND hwndDlg,
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
FillMonthsComboBox(GetDlgItem(hwndDlg,
|
||||
IDC_MONTHCB));
|
||||
|
||||
|
@ -290,21 +286,16 @@ DateTimePageProc(HWND hwndDlg,
|
|||
SendMessage(GetDlgItem(hwndDlg, IDC_YEAR), UDM_SETPOS, 0, MAKELONG( (short) st.wYear, 0));
|
||||
|
||||
pOldWndProc = (WNDPROC) SetWindowLongPtr(GetDlgItem(hwndDlg, IDC_TIMEPICKER), GWL_WNDPROC, (INT_PTR) DTPProc);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_TIMER:
|
||||
{
|
||||
SendMessage(GetDlgItem(hwndDlg, IDC_TIMEPICKER), DTM_SETSYSTEMTIME, GDT_VALID, (LPARAM) &st);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
switch (LOWORD(wParam))
|
||||
{
|
||||
case IDC_MONTHCB:
|
||||
{
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||
{
|
||||
ChangeMonthCalDate(GetDlgItem(hwndDlg,
|
||||
|
@ -313,18 +304,13 @@ DateTimePageProc(HWND hwndDlg,
|
|||
GetCBSelectedMonth((HWND)lParam),
|
||||
(WORD) -1);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_CTLCOLORSTATIC:
|
||||
{
|
||||
if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_YEARTEXT))
|
||||
return (INT_PTR) GetSysColorBrush(COLOR_WINDOW);
|
||||
|
||||
}
|
||||
if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_YEARTEXT))
|
||||
return (INT_PTR)GetSysColorBrush(COLOR_WINDOW);
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
|
@ -334,14 +320,13 @@ DateTimePageProc(HWND hwndDlg,
|
|||
switch (lpnm->idFrom)
|
||||
{
|
||||
case IDC_YEAR:
|
||||
{
|
||||
switch (lpnm->code)
|
||||
{
|
||||
case UDN_DELTAPOS:
|
||||
{
|
||||
short wYear;
|
||||
LPNMUPDOWN updown = (LPNMUPDOWN) lpnm;
|
||||
wYear = (short) SendMessage(GetDlgItem(hwndDlg, IDC_YEAR), UDM_GETPOS, 0, 0);
|
||||
SHORT wYear;
|
||||
LPNMUPDOWN updown = (LPNMUPDOWN)lpnm;
|
||||
wYear = (SHORT)SendMessage(GetDlgItem(hwndDlg, IDC_YEAR), UDM_GETPOS, 0, 0);
|
||||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
ChangeMonthCalDate(GetDlgItem(hwndDlg,
|
||||
|
@ -352,15 +337,12 @@ DateTimePageProc(HWND hwndDlg,
|
|||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_TIMEPICKER:
|
||||
{
|
||||
switch (lpnm->code)
|
||||
{
|
||||
case DTN_DATETIMECHANGE:
|
||||
{
|
||||
/* Stop the timer */
|
||||
KillTimer(hwndDlg, ID_TIMER);
|
||||
|
||||
|
@ -370,73 +352,54 @@ DateTimePageProc(HWND hwndDlg,
|
|||
|
||||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_MONTHCALENDAR:
|
||||
{
|
||||
switch (lpnm->code)
|
||||
{
|
||||
case MCCN_SELCHANGE:
|
||||
{
|
||||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case MCCN_AUTOUPDATE:
|
||||
{
|
||||
AutoUpdateMonthCal(hwndDlg,
|
||||
(PNMMCCAUTOUPDATE)lpnm);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
switch (lpnm->code)
|
||||
{
|
||||
case PSN_SETACTIVE:
|
||||
{
|
||||
SetTimeZoneName(hwndDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case PSN_APPLY:
|
||||
{
|
||||
SetLocalSystemTime(hwndDlg);
|
||||
SetTimer(hwndDlg, ID_TIMER, 1000, NULL);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_TIMECHANGE:
|
||||
{
|
||||
/* FIXME - we don't get this message as we're not a top-level window... */
|
||||
SendMessage(GetDlgItem(hwndDlg,
|
||||
IDC_MONTHCALENDAR),
|
||||
MCCM_RESET,
|
||||
0,
|
||||
0);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
KillTimer(hwndDlg, ID_TIMER);
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
|
|
|
@ -13,74 +13,74 @@ static VOID
|
|||
CreateNTPServerList(HWND hwnd)
|
||||
{
|
||||
HWND hList;
|
||||
WCHAR ValName[MAX_VALUE_NAME];
|
||||
WCHAR Data[256];
|
||||
DWORD Index = 0;
|
||||
DWORD ValSize;
|
||||
TCHAR szValName[MAX_VALUE_NAME];
|
||||
TCHAR szData[256];
|
||||
DWORD dwIndex = 0;
|
||||
DWORD dwValSize;
|
||||
DWORD dwNameSize;
|
||||
DWORD Default = 1;
|
||||
LONG Ret;
|
||||
DWORD dwDefault = 1;
|
||||
LONG lRet;
|
||||
HKEY hKey;
|
||||
|
||||
hList = GetDlgItem(hwnd,
|
||||
IDC_SERVERLIST);
|
||||
|
||||
Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers",
|
||||
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
return;
|
||||
|
||||
while (TRUE)
|
||||
{
|
||||
ValSize = MAX_VALUE_NAME;
|
||||
ValName[0] = '\0';
|
||||
Ret = RegEnumValueW(hKey,
|
||||
Index,
|
||||
ValName,
|
||||
&ValSize,
|
||||
dwValSize = MAX_VALUE_NAME * sizeof(TCHAR);
|
||||
szValName[0] = '\0';
|
||||
lRet = RegEnumValue(hKey,
|
||||
dwIndex,
|
||||
szValName,
|
||||
&dwValSize,
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)Data,
|
||||
(LPBYTE)szData,
|
||||
&dwNameSize);
|
||||
|
||||
if (Ret == ERROR_SUCCESS)
|
||||
if (lRet == ERROR_SUCCESS)
|
||||
{
|
||||
/* get date from default reg value */
|
||||
if (wcscmp(ValName, L"") == 0) // if (Index == 0)
|
||||
if (_tcscmp(szValName, _T("")) == 0) // if (Index == 0)
|
||||
{
|
||||
Default = _wtoi(Data);
|
||||
Index++;
|
||||
dwDefault = _ttoi(szData);
|
||||
dwIndex++;
|
||||
}
|
||||
else
|
||||
{
|
||||
SendMessageW(hList,
|
||||
SendMessage(hList,
|
||||
CB_ADDSTRING,
|
||||
0,
|
||||
(LPARAM)Data);
|
||||
Index++;
|
||||
(LPARAM)szData);
|
||||
dwIndex++;
|
||||
}
|
||||
}
|
||||
else if (Ret != ERROR_MORE_DATA)
|
||||
else if (lRet != ERROR_MORE_DATA)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (Default < 1 || Default > Index)
|
||||
Default = 1;
|
||||
if (dwDefault < 1 || dwDefault > dwIndex)
|
||||
dwDefault = 1;
|
||||
|
||||
/* server reg entries count from 1,
|
||||
* combo boxes count from 0 */
|
||||
Default--;
|
||||
dwDefault--;
|
||||
|
||||
SendMessage(hList,
|
||||
CB_SETCURSEL,
|
||||
Default,
|
||||
dwDefault,
|
||||
0);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -90,110 +90,100 @@ SetNTPServer(HWND hwnd)
|
|||
{
|
||||
HKEY hKey;
|
||||
HWND hList;
|
||||
UINT Sel;
|
||||
WCHAR szSel[4];
|
||||
LONG Ret;
|
||||
UINT uSel;
|
||||
TCHAR szSel[4];
|
||||
LONG lRet;
|
||||
|
||||
hList = GetDlgItem(hwnd,
|
||||
IDC_SERVERLIST);
|
||||
|
||||
Sel = (UINT)SendMessage(hList,
|
||||
CB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
uSel = (UINT)SendMessage(hList, CB_GETCURSEL, 0, 0);
|
||||
|
||||
/* server reg entries count from 1,
|
||||
* combo boxes count from 0 */
|
||||
Sel++;
|
||||
uSel++;
|
||||
|
||||
/* convert to wide char */
|
||||
_itow(Sel, szSel, 10);
|
||||
_itow(uSel, szSel, 10);
|
||||
|
||||
Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers",
|
||||
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers"),
|
||||
0,
|
||||
KEY_SET_VALUE,
|
||||
&hKey);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
{
|
||||
DisplayWin32Error(Ret);
|
||||
DisplayWin32Error(lRet);
|
||||
return;
|
||||
}
|
||||
|
||||
Ret = RegSetValueExW(hKey,
|
||||
L"",
|
||||
lRet = RegSetValueExW(hKey,
|
||||
_T(""),
|
||||
0,
|
||||
REG_SZ,
|
||||
(LPBYTE)szSel,
|
||||
sizeof(szSel));
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
DisplayWin32Error(Ret);
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
DisplayWin32Error(lRet);
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* get the domain name from the registry */
|
||||
static BOOL
|
||||
GetNTPServerAddress(LPWSTR* lpAddress)
|
||||
GetNTPServerAddress(LPTSTR *lpAddress)
|
||||
{
|
||||
HKEY hKey;
|
||||
WCHAR szSel[4];
|
||||
TCHAR szSel[4];
|
||||
DWORD dwSize;
|
||||
LONG Ret;
|
||||
LONG lRet;
|
||||
|
||||
Ret = RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers",
|
||||
lRet = RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Servers"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
{
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Get data from default value */
|
||||
dwSize = sizeof(szSel);
|
||||
Ret = RegQueryValueExW(hKey,
|
||||
L"",
|
||||
dwSize = 4 * sizeof(TCHAR);
|
||||
lRet = RegQueryValueEx(hKey,
|
||||
_T(""),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)szSel,
|
||||
&dwSize);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
|
||||
dwSize = 0;
|
||||
Ret = RegQueryValueExW(hKey,
|
||||
lRet = RegQueryValueEx(hKey,
|
||||
szSel,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
&dwSize);
|
||||
if (Ret == ERROR_SUCCESS)
|
||||
{
|
||||
(*lpAddress) = (LPWSTR) HeapAlloc(GetProcessHeap(),
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
(*lpAddress) = (LPTSTR)HeapAlloc(GetProcessHeap(),
|
||||
0,
|
||||
dwSize);
|
||||
if ((*lpAddress) == NULL)
|
||||
{
|
||||
Ret = ERROR_NOT_ENOUGH_MEMORY;
|
||||
lRet = ERROR_NOT_ENOUGH_MEMORY;
|
||||
goto fail;
|
||||
}
|
||||
|
||||
Ret = RegQueryValueExW(hKey,
|
||||
lRet = RegQueryValueEx(hKey,
|
||||
szSel,
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)*lpAddress,
|
||||
&dwSize);
|
||||
if (Ret != ERROR_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
}
|
||||
else
|
||||
if (lRet != ERROR_SUCCESS)
|
||||
goto fail;
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
@ -201,11 +191,11 @@ GetNTPServerAddress(LPWSTR* lpAddress)
|
|||
return TRUE;
|
||||
|
||||
fail:
|
||||
DisplayWin32Error(Ret);
|
||||
if (hKey) RegCloseKey(hKey);
|
||||
DisplayWin32Error(lRet);
|
||||
if (hKey)
|
||||
RegCloseKey(hKey);
|
||||
HeapFree(GetProcessHeap(), 0, *lpAddress);
|
||||
return FALSE;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -213,7 +203,7 @@ fail:
|
|||
static ULONG
|
||||
GetTimeFromServer(VOID)
|
||||
{
|
||||
LPWSTR lpAddress = NULL;
|
||||
LPTSTR lpAddress = NULL;
|
||||
ULONG ulTime = 0;
|
||||
|
||||
if (GetNTPServerAddress(&lpAddress))
|
||||
|
@ -250,7 +240,7 @@ UpdateSystemTime(ULONG ulTime)
|
|||
stNew.wMilliseconds = 0;
|
||||
|
||||
/* convert to a file time */
|
||||
if (! SystemTimeToFileTime(&stNew, &ftNew))
|
||||
if (!SystemTimeToFileTime(&stNew, &ftNew))
|
||||
{
|
||||
DisplayWin32Error(GetLastError());
|
||||
return;
|
||||
|
@ -262,7 +252,7 @@ UpdateSystemTime(ULONG ulTime)
|
|||
ftNew = * (FILETIME *)&li;
|
||||
|
||||
/* convert back to a system time */
|
||||
if (! FileTimeToSystemTime(&ftNew, &stNew))
|
||||
if (!FileTimeToSystemTime(&ftNew, &stNew))
|
||||
{
|
||||
DisplayWin32Error(GetLastError());
|
||||
return;
|
||||
|
@ -270,7 +260,6 @@ UpdateSystemTime(ULONG ulTime)
|
|||
|
||||
if (!SystemSetLocalTime(&stNew))
|
||||
DisplayWin32Error(GetLastError());
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -278,10 +267,10 @@ static VOID
|
|||
EnableDialogText(HWND hwnd)
|
||||
{
|
||||
BOOL bChecked;
|
||||
HWND hCheck = GetDlgItem(hwnd, IDC_AUTOSYNC);
|
||||
UINT Check = (UINT)SendMessageW(hCheck, BM_GETCHECK, 0, 0);
|
||||
UINT uCheck;
|
||||
|
||||
bChecked = (Check == BST_CHECKED) ? TRUE : FALSE;
|
||||
uCheck = (UINT)SendDlgItemMessage(hwnd, IDC_AUTOSYNC, BM_GETCHECK, 0, 0);
|
||||
bChecked = (uCheck == BST_CHECKED) ? TRUE : FALSE;
|
||||
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_SERVERTEXT), bChecked);
|
||||
EnableWindow(GetDlgItem(hwnd, IDC_SERVERLIST), bChecked);
|
||||
|
@ -295,30 +284,27 @@ static VOID
|
|||
GetSyncSetting(HWND hwnd)
|
||||
{
|
||||
HKEY hKey;
|
||||
HWND hCheck;
|
||||
WCHAR Data[8];
|
||||
DWORD Size;
|
||||
TCHAR szData[8];
|
||||
DWORD dwSize;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Parameters",
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\DateTime\\Parameters"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey) == ERROR_SUCCESS)
|
||||
{
|
||||
Size = sizeof(Data);
|
||||
if (RegQueryValueExW(hKey,
|
||||
L"Type",
|
||||
dwSize = 8 * sizeof(TCHAR);
|
||||
if (RegQueryValueEx(hKey,
|
||||
_T("Type"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)Data,
|
||||
&Size) == ERROR_SUCCESS)
|
||||
(LPBYTE)szData,
|
||||
&dwSize) == ERROR_SUCCESS)
|
||||
{
|
||||
if (lstrcmp(Data, L"NTP") == 0)
|
||||
{
|
||||
hCheck = GetDlgItem(hwnd, IDC_AUTOSYNC);
|
||||
SendMessageW(hCheck, BM_SETCHECK, 0, 0);
|
||||
}
|
||||
if (_tcscmp(szData, _T("NTP")) == 0)
|
||||
SendDlgItemMessage(hwnd, IDC_AUTOSYNC, BM_SETCHECK, 0, 0);
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
}
|
||||
|
@ -328,9 +314,7 @@ static VOID
|
|||
OnInitDialog(HWND hwnd)
|
||||
{
|
||||
GetSyncSetting(hwnd);
|
||||
|
||||
EnableDialogText(hwnd);
|
||||
|
||||
CreateNTPServerList(hwnd);
|
||||
}
|
||||
|
||||
|
@ -345,9 +329,7 @@ InetTimePageProc(HWND hwndDlg,
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
OnInitDialog(hwndDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
|
@ -362,20 +344,18 @@ InetTimePageProc(HWND hwndDlg,
|
|||
ulTime = GetTimeFromServer();
|
||||
if (ulTime != 0)
|
||||
UpdateSystemTime(ulTime);
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_SERVERLIST:
|
||||
{
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE)
|
||||
{
|
||||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
break;
|
||||
|
||||
case IDC_AUTOSYNC:
|
||||
{
|
||||
if (HIWORD(wParam) == BN_CLICKED)
|
||||
{
|
||||
EnableDialogText(hwndDlg);
|
||||
|
@ -383,7 +363,6 @@ InetTimePageProc(HWND hwndDlg,
|
|||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
@ -398,9 +377,7 @@ InetTimePageProc(HWND hwndDlg,
|
|||
switch (lpnm->code)
|
||||
{
|
||||
case PSN_APPLY:
|
||||
|
||||
SetNTPServer(hwndDlg);
|
||||
|
||||
return TRUE;
|
||||
|
||||
default:
|
||||
|
|
|
@ -249,9 +249,7 @@ MonthCalReload(IN PMONTHCALWND infoPtr)
|
|||
infoPtr->hbHeader = GetSysColorBrush(infoPtr->Enabled ? MONTHCAL_HEADERBG : MONTHCAL_DISABLED_HEADERBG);
|
||||
infoPtr->hbSelection = GetSysColorBrush(infoPtr->Enabled ? MONTHCAL_SELBG : MONTHCAL_DISABLED_SELBG);
|
||||
|
||||
for (i = 0;
|
||||
i < 7;
|
||||
i++)
|
||||
for (i = 0; i < 7; i++)
|
||||
{
|
||||
if (GetLocaleInfo(LOCALE_USER_DEFAULT,
|
||||
LOCALE_SABBREVDAYNAME1 +
|
||||
|
|
|
@ -58,7 +58,7 @@ InitConnection(PINFO pInfo,
|
|||
|
||||
|
||||
static VOID
|
||||
DestroyConnection()
|
||||
DestroyConnection(VOID)
|
||||
{
|
||||
WSACleanup();
|
||||
}
|
||||
|
@ -67,7 +67,6 @@ DestroyConnection()
|
|||
static BOOL
|
||||
GetTransmitTime(PTIMEPACKET ptp)
|
||||
{
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -179,5 +178,4 @@ GetServerTime(LPWSTR lpAddress)
|
|||
HeapFree(GetProcessHeap(), 0, lpAddr);
|
||||
|
||||
return ulTime;
|
||||
|
||||
}
|
||||
|
|
|
@ -118,7 +118,7 @@ CPlApplet(HWND hwndCpl,
|
|||
LPARAM lParam1,
|
||||
LPARAM lParam2)
|
||||
{
|
||||
int i = (int)lParam1;
|
||||
INT i = (INT)lParam1;
|
||||
|
||||
switch (uMsg)
|
||||
{
|
||||
|
|
|
@ -59,7 +59,7 @@ GetLargerTimeZoneEntry(DWORD Index)
|
|||
static VOID
|
||||
CreateTimeZoneList(VOID)
|
||||
{
|
||||
WCHAR szKeyName[256];
|
||||
TCHAR szKeyName[256];
|
||||
DWORD dwIndex;
|
||||
DWORD dwNameSize;
|
||||
DWORD dwValueSize;
|
||||
|
@ -70,8 +70,8 @@ CreateTimeZoneList(VOID)
|
|||
PTIMEZONE_ENTRY Entry;
|
||||
PTIMEZONE_ENTRY Current;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"),
|
||||
0,
|
||||
KEY_ENUMERATE_SUB_KEYS,
|
||||
&hZonesKey))
|
||||
|
@ -80,8 +80,8 @@ CreateTimeZoneList(VOID)
|
|||
dwIndex = 0;
|
||||
while (TRUE)
|
||||
{
|
||||
dwNameSize = 256;
|
||||
lError = RegEnumKeyExW(hZonesKey,
|
||||
dwNameSize = 256 * sizeof(TCHAR);
|
||||
lError = RegEnumKeyEx(hZonesKey,
|
||||
dwIndex,
|
||||
szKeyName,
|
||||
&dwNameSize,
|
||||
|
@ -92,7 +92,7 @@ CreateTimeZoneList(VOID)
|
|||
if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA)
|
||||
break;
|
||||
|
||||
if (RegOpenKeyExW(hZonesKey,
|
||||
if (RegOpenKeyEx(hZonesKey,
|
||||
szKeyName,
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
|
@ -106,9 +106,9 @@ CreateTimeZoneList(VOID)
|
|||
break;
|
||||
}
|
||||
|
||||
dwValueSize = 64 * sizeof(WCHAR);
|
||||
if (RegQueryValueExW(hZoneKey,
|
||||
L"Display",
|
||||
dwValueSize = 64 * sizeof(TCHAR);
|
||||
if (RegQueryValueEx(hZoneKey,
|
||||
_T("Display"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Entry->Description,
|
||||
|
@ -118,9 +118,9 @@ CreateTimeZoneList(VOID)
|
|||
break;
|
||||
}
|
||||
|
||||
dwValueSize = 33 * sizeof(WCHAR);
|
||||
if (RegQueryValueExW(hZoneKey,
|
||||
L"Std",
|
||||
dwValueSize = 33 * sizeof(TCHAR);
|
||||
if (RegQueryValueEx(hZoneKey,
|
||||
_T("Std"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Entry->StandardName,
|
||||
|
@ -130,9 +130,9 @@ CreateTimeZoneList(VOID)
|
|||
break;
|
||||
}
|
||||
|
||||
dwValueSize = 33 * sizeof(WCHAR);
|
||||
if (RegQueryValueExW(hZoneKey,
|
||||
L"Dlt",
|
||||
dwValueSize = 33 * sizeof(TCHAR);
|
||||
if (RegQueryValueEx(hZoneKey,
|
||||
_T("Dlt"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Entry->DaylightName,
|
||||
|
@ -143,8 +143,8 @@ CreateTimeZoneList(VOID)
|
|||
}
|
||||
|
||||
dwValueSize = sizeof(DWORD);
|
||||
if (RegQueryValueExW(hZoneKey,
|
||||
L"Index",
|
||||
if (RegQueryValueEx(hZoneKey,
|
||||
_T("Index"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Entry->Index,
|
||||
|
@ -155,8 +155,8 @@ CreateTimeZoneList(VOID)
|
|||
}
|
||||
|
||||
dwValueSize = sizeof(TZ_INFO);
|
||||
if (RegQueryValueExW(hZoneKey,
|
||||
L"TZI",
|
||||
if (RegQueryValueEx(hZoneKey,
|
||||
_T("TZI"),
|
||||
NULL,
|
||||
NULL,
|
||||
(LPBYTE)&Entry->TimezoneInfo,
|
||||
|
@ -252,19 +252,19 @@ ShowTimeZoneList(HWND hwnd)
|
|||
Entry = TimeZoneListHead;
|
||||
while (Entry != NULL)
|
||||
{
|
||||
SendMessageW(hwnd,
|
||||
SendMessage(hwnd,
|
||||
CB_ADDSTRING,
|
||||
0,
|
||||
(LPARAM)Entry->Description);
|
||||
|
||||
if (!wcscmp(Entry->StandardName, TimeZoneInfo.StandardName))
|
||||
if (!_tcscmp(Entry->StandardName, TimeZoneInfo.StandardName))
|
||||
dwIndex = i;
|
||||
|
||||
i++;
|
||||
Entry = Entry->Next;
|
||||
}
|
||||
|
||||
SendMessageW(hwnd,
|
||||
SendMessage(hwnd,
|
||||
CB_SETCURSEL,
|
||||
(WPARAM)dwIndex,
|
||||
0);
|
||||
|
@ -279,7 +279,7 @@ SetLocalTimeZone(HWND hwnd)
|
|||
DWORD dwIndex;
|
||||
DWORD i;
|
||||
|
||||
dwIndex = (DWORD) SendMessage(hwnd,
|
||||
dwIndex = (DWORD)SendMessage(hwnd,
|
||||
CB_GETCURSEL,
|
||||
0,
|
||||
0);
|
||||
|
@ -295,9 +295,9 @@ SetLocalTimeZone(HWND hwnd)
|
|||
Entry = Entry->Next;
|
||||
}
|
||||
|
||||
wcscpy(TimeZoneInformation.StandardName,
|
||||
_tcscpy(TimeZoneInformation.StandardName,
|
||||
Entry->StandardName);
|
||||
wcscpy(TimeZoneInformation.DaylightName,
|
||||
_tcscpy(TimeZoneInformation.DaylightName,
|
||||
Entry->DaylightName);
|
||||
|
||||
TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
|
||||
|
@ -321,8 +321,8 @@ GetAutoDaylightInfo(HWND hwnd)
|
|||
{
|
||||
HKEY hKey;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"),
|
||||
0,
|
||||
KEY_QUERY_VALUE,
|
||||
&hKey))
|
||||
|
@ -331,8 +331,8 @@ GetAutoDaylightInfo(HWND hwnd)
|
|||
/* if the call fails (non zero), the reg value isn't available,
|
||||
* which means it shouldn't be disabled, so we should check the button.
|
||||
*/
|
||||
if (RegQueryValueExW(hKey,
|
||||
L"DisableAutoDaylightTimeSet",
|
||||
if (RegQueryValueEx(hKey,
|
||||
_T("DisableAutoDaylightTimeSet"),
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
|
@ -355,8 +355,8 @@ SetAutoDaylightInfo(HWND hwnd)
|
|||
HKEY hKey;
|
||||
DWORD dwValue = 1;
|
||||
|
||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
||||
L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
|
||||
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||
_T("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"),
|
||||
0,
|
||||
KEY_SET_VALUE,
|
||||
&hKey))
|
||||
|
@ -364,8 +364,8 @@ SetAutoDaylightInfo(HWND hwnd)
|
|||
|
||||
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED)
|
||||
{
|
||||
RegSetValueExW(hKey,
|
||||
L"DisableAutoDaylightTimeSet",
|
||||
RegSetValueEx(hKey,
|
||||
_T("DisableAutoDaylightTimeSet"),
|
||||
0,
|
||||
REG_DWORD,
|
||||
(LPBYTE)&dwValue,
|
||||
|
@ -373,8 +373,8 @@ SetAutoDaylightInfo(HWND hwnd)
|
|||
}
|
||||
else
|
||||
{
|
||||
RegDeleteValueW(hKey,
|
||||
L"DisableAutoDaylightTimeSet");
|
||||
RegDeleteValue(hKey,
|
||||
_T("DisableAutoDaylightTimeSet"));
|
||||
}
|
||||
|
||||
RegCloseKey(hKey);
|
||||
|
@ -393,7 +393,6 @@ TimeZonePageProc(HWND hwndDlg,
|
|||
switch (uMsg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
{
|
||||
CreateTimeZoneList();
|
||||
ShowTimeZoneList(GetDlgItem(hwndDlg, IDC_TIMEZONELIST));
|
||||
GetAutoDaylightInfo(GetDlgItem(hwndDlg, IDC_AUTODAYLIGHT));
|
||||
|
@ -405,7 +404,6 @@ TimeZonePageProc(HWND hwndDlg,
|
|||
cxSource = bitmap.bmWidth;
|
||||
cySource = bitmap.bmHeight;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DRAWITEM:
|
||||
|
@ -430,21 +428,17 @@ TimeZonePageProc(HWND hwndDlg,
|
|||
break;
|
||||
|
||||
case WM_COMMAND:
|
||||
{
|
||||
if ((LOWORD(wParam) == IDC_TIMEZONELIST && HIWORD(wParam) == CBN_SELCHANGE) ||
|
||||
(LOWORD(wParam) == IDC_AUTODAYLIGHT && HIWORD(wParam) == BN_CLICKED))
|
||||
{
|
||||
/* Enable the 'Apply' button */
|
||||
PropSheet_Changed(GetParent(hwndDlg), hwndDlg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_DESTROY:
|
||||
{
|
||||
DestroyTimeZoneList();
|
||||
DeleteObject(hBitmap);
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_NOTIFY:
|
||||
|
|
Loading…
Reference in a new issue