mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 21:53:06 +00:00
Preselect the timezone based on the current user language.
svn path=/trunk/; revision=11801
This commit is contained in:
parent
c5881e6a93
commit
0229e6cb3a
3 changed files with 312 additions and 205 deletions
|
@ -30,9 +30,9 @@ typedef struct _TIMEZONE_ENTRY
|
||||||
{
|
{
|
||||||
struct _TIMEZONE_ENTRY *Prev;
|
struct _TIMEZONE_ENTRY *Prev;
|
||||||
struct _TIMEZONE_ENTRY *Next;
|
struct _TIMEZONE_ENTRY *Next;
|
||||||
WCHAR Description[64]; /* 'Display' */
|
TCHAR Description[64]; /* 'Display' */
|
||||||
WCHAR StandardName[32]; /* 'Std' */
|
TCHAR StandardName[32]; /* 'Std' */
|
||||||
WCHAR DaylightName[32]; /* 'Dlt' */
|
TCHAR DaylightName[32]; /* 'Dlt' */
|
||||||
TZ_INFO TimezoneInfo; /* 'TZI' */
|
TZ_INFO TimezoneInfo; /* 'TZI' */
|
||||||
ULONG Index;
|
ULONG Index;
|
||||||
} TIMEZONE_ENTRY, *PTIMEZONE_ENTRY;
|
} TIMEZONE_ENTRY, *PTIMEZONE_ENTRY;
|
||||||
|
|
|
@ -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: install.c,v 1.19 2004/11/12 18:23:31 gvg Exp $
|
/* $Id: install.c,v 1.20 2004/11/24 23:09:46 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -79,13 +79,13 @@ static BOOL
|
||||||
RunVMWInstall(VOID)
|
RunVMWInstall(VOID)
|
||||||
{
|
{
|
||||||
PROCESS_INFORMATION ProcInfo;
|
PROCESS_INFORMATION ProcInfo;
|
||||||
STARTUPINFOA si;
|
STARTUPINFO si;
|
||||||
|
|
||||||
ZeroMemory(&si, sizeof(STARTUPINFO));
|
ZeroMemory(&si, sizeof(STARTUPINFO));
|
||||||
si.cb = sizeof(STARTUPINFO);
|
si.cb = sizeof(STARTUPINFO);
|
||||||
|
|
||||||
if(CreateProcessA(NULL, "vmwinst.exe", NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS,
|
if(CreateProcess(NULL, _T("vmwinst.exe"), NULL, NULL, TRUE, NORMAL_PRIORITY_CLASS,
|
||||||
NULL, NULL, &si, &ProcInfo))
|
NULL, NULL, &si, &ProcInfo))
|
||||||
{
|
{
|
||||||
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
|
WaitForSingleObject(ProcInfo.hProcess, INFINITE);
|
||||||
CloseHandle(ProcInfo.hThread);
|
CloseHandle(ProcInfo.hThread);
|
||||||
|
@ -196,57 +196,57 @@ RestartDlgProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||||
static VOID
|
static VOID
|
||||||
CreateTempDir(LPCWSTR VarName)
|
CreateTempDir(LPCWSTR VarName)
|
||||||
{
|
{
|
||||||
WCHAR szTempDir[MAX_PATH];
|
TCHAR szTempDir[MAX_PATH];
|
||||||
WCHAR szBuffer[MAX_PATH];
|
TCHAR szBuffer[MAX_PATH];
|
||||||
DWORD dwLength;
|
DWORD dwLength;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
|
|
||||||
if (RegOpenKeyExW (HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment",
|
_T("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment"),
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&hKey))
|
&hKey))
|
||||||
{
|
{
|
||||||
DebugPrint("Error: %lu\n", GetLastError());
|
DebugPrint("Error: %lu\n", GetLastError());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get temp dir */
|
/* Get temp dir */
|
||||||
dwLength = MAX_PATH * sizeof(WCHAR);
|
dwLength = MAX_PATH * sizeof(TCHAR);
|
||||||
if (RegQueryValueExW (hKey,
|
if (RegQueryValueEx(hKey,
|
||||||
VarName,
|
VarName,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(LPBYTE)szBuffer,
|
(LPBYTE)szBuffer,
|
||||||
&dwLength))
|
&dwLength))
|
||||||
{
|
{
|
||||||
DebugPrint("Error: %lu\n", GetLastError());
|
DebugPrint("Error: %lu\n", GetLastError());
|
||||||
RegCloseKey (hKey);
|
RegCloseKey(hKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Expand it */
|
/* Expand it */
|
||||||
if (!ExpandEnvironmentStringsW (szBuffer,
|
if (!ExpandEnvironmentStrings(szBuffer,
|
||||||
szTempDir,
|
szTempDir,
|
||||||
MAX_PATH))
|
MAX_PATH))
|
||||||
{
|
{
|
||||||
DebugPrint("Error: %lu\n", GetLastError());
|
DebugPrint("Error: %lu\n", GetLastError());
|
||||||
RegCloseKey (hKey);
|
RegCloseKey(hKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Create profiles directory */
|
/* Create profiles directory */
|
||||||
if (!CreateDirectoryW (szTempDir, NULL))
|
if (!CreateDirectory(szTempDir, NULL))
|
||||||
{
|
{
|
||||||
if (GetLastError () != ERROR_ALREADY_EXISTS)
|
if (GetLastError() != ERROR_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
DebugPrint("Error: %lu\n", GetLastError());
|
DebugPrint("Error: %lu\n", GetLastError());
|
||||||
RegCloseKey (hKey);
|
RegCloseKey(hKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
RegCloseKey (hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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: wizard.c,v 1.14 2004/11/22 11:01:45 gvg Exp $
|
/* $Id: wizard.c,v 1.15 2004/11/24 23:09:46 ekohl Exp $
|
||||||
*
|
*
|
||||||
* COPYRIGHT: See COPYING in the top level directory
|
* COPYRIGHT: See COPYING in the top level directory
|
||||||
* PROJECT: ReactOS system libraries
|
* PROJECT: ReactOS system libraries
|
||||||
|
@ -29,15 +29,13 @@
|
||||||
|
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#include <windowsx.h>
|
#include <windowsx.h>
|
||||||
#include <tchar.h>
|
|
||||||
#include <commctrl.h>
|
#include <commctrl.h>
|
||||||
|
#include <tchar.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <setupapi.h>
|
#include <setupapi.h>
|
||||||
|
|
||||||
#include <syssetup.h>
|
#include <syssetup.h>
|
||||||
|
|
||||||
|
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
#include "resource.h"
|
#include "resource.h"
|
||||||
|
|
||||||
|
@ -87,7 +85,7 @@ CreateTitleFont(VOID)
|
||||||
|
|
||||||
LogFont = ncm.lfMessageFont;
|
LogFont = ncm.lfMessageFont;
|
||||||
LogFont.lfWeight = FW_BOLD;
|
LogFont.lfWeight = FW_BOLD;
|
||||||
wcscpy(LogFont.lfFaceName, L"MS Shell Dlg");
|
_tcscpy(LogFont.lfFaceName, _T("MS Shell Dlg"));
|
||||||
|
|
||||||
hdc = GetDC(NULL);
|
hdc = GetDC(NULL);
|
||||||
FontSize = 12;
|
FontSize = 12;
|
||||||
|
@ -297,8 +295,8 @@ AckPageDlgProc(HWND hwndDlg,
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_COMMAND:
|
case WM_COMMAND:
|
||||||
if (HIWORD(wParam) == BN_CLICKED && IDC_VIEWGPL == LOWORD(wParam))
|
if (HIWORD(wParam) == BN_CLICKED && IDC_VIEWGPL == LOWORD(wParam))
|
||||||
{
|
{
|
||||||
DialogBox(hDllInstance, MAKEINTRESOURCE(IDD_GPL), NULL, GplDlgProc);
|
DialogBox(hDllInstance, MAKEINTRESOURCE(IDD_GPL), NULL, GplDlgProc);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -334,8 +332,8 @@ OwnerPageDlgProc(HWND hwndDlg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
WCHAR OwnerName[51];
|
TCHAR OwnerName[51];
|
||||||
WCHAR OwnerOrganization[51];
|
TCHAR OwnerOrganization[51];
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
LPNMHDR lpnm;
|
LPNMHDR lpnm;
|
||||||
|
|
||||||
|
@ -343,8 +341,8 @@ OwnerPageDlgProc(HWND hwndDlg,
|
||||||
{
|
{
|
||||||
case WM_INITDIALOG:
|
case WM_INITDIALOG:
|
||||||
{
|
{
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_OWNERNAME, EM_LIMITTEXT, 50, 0);
|
SendDlgItemMessage(hwndDlg, IDC_OWNERNAME, EM_LIMITTEXT, 50, 0);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_OWNERORGANIZATION, EM_LIMITTEXT, 50, 0);
|
SendDlgItemMessage(hwndDlg, IDC_OWNERORGANIZATION, EM_LIMITTEXT, 50, 0);
|
||||||
|
|
||||||
/* Set focus to owner name */
|
/* Set focus to owner name */
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
|
SetFocus(GetDlgItem(hwndDlg, IDC_OWNERNAME));
|
||||||
|
@ -367,9 +365,9 @@ OwnerPageDlgProc(HWND hwndDlg,
|
||||||
OwnerName[0] = 0;
|
OwnerName[0] = 0;
|
||||||
if (GetDlgItemText(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
|
if (GetDlgItemText(hwndDlg, IDC_OWNERNAME, OwnerName, 50) == 0)
|
||||||
{
|
{
|
||||||
MessageBoxW(hwndDlg,
|
MessageBox(hwndDlg,
|
||||||
L"Setup cannot continue until you enter your name.",
|
_T("Setup cannot continue until you enter your name."),
|
||||||
L"ReactOS Setup",
|
_T("ReactOS Setup"),
|
||||||
MB_ICONERROR | MB_OK);
|
MB_ICONERROR | MB_OK);
|
||||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -378,27 +376,27 @@ OwnerPageDlgProc(HWND hwndDlg,
|
||||||
OwnerOrganization[0] = 0;
|
OwnerOrganization[0] = 0;
|
||||||
GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
|
GetDlgItemTextW(hwndDlg, IDC_OWNERORGANIZATION, OwnerOrganization, 50);
|
||||||
|
|
||||||
RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
L"Software\\Microsoft\\Windows NT\\CurrentVersion",
|
_T("Software\\Microsoft\\Windows NT\\CurrentVersion"),
|
||||||
|
0,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&hKey);
|
||||||
|
/* FIXME: check error code */
|
||||||
|
|
||||||
|
RegSetValueEx(hKey,
|
||||||
|
_T("RegisteredOwner"),
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
REG_SZ,
|
||||||
&hKey);
|
(LPBYTE)OwnerName,
|
||||||
|
(_tcslen(OwnerName) + 1) * sizeof(TCHAR));
|
||||||
/* FIXME: check error code */
|
/* FIXME: check error code */
|
||||||
|
|
||||||
RegSetValueExW(hKey,
|
RegSetValueEx(hKey,
|
||||||
L"RegisteredOwner",
|
_T("RegisteredOrganization"),
|
||||||
0,
|
0,
|
||||||
REG_SZ,
|
REG_SZ,
|
||||||
(LPBYTE)OwnerName,
|
(LPBYTE)OwnerOrganization,
|
||||||
(wcslen(OwnerName) + 1) * sizeof(WCHAR));
|
(_tcslen(OwnerOrganization) + 1) * sizeof(TCHAR));
|
||||||
/* FIXME: check error code */
|
|
||||||
|
|
||||||
RegSetValueExW(hKey,
|
|
||||||
L"RegisteredOrganization",
|
|
||||||
0,
|
|
||||||
REG_SZ,
|
|
||||||
(LPBYTE)OwnerOrganization,
|
|
||||||
(wcslen(OwnerOrganization) + 1) * sizeof(WCHAR));
|
|
||||||
/* FIXME: check error code */
|
/* FIXME: check error code */
|
||||||
|
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
|
@ -424,9 +422,9 @@ ComputerPageDlgProc(HWND hwndDlg,
|
||||||
WPARAM wParam,
|
WPARAM wParam,
|
||||||
LPARAM lParam)
|
LPARAM lParam)
|
||||||
{
|
{
|
||||||
WCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
|
TCHAR ComputerName[MAX_COMPUTERNAME_LENGTH + 1];
|
||||||
WCHAR Password1[15];
|
TCHAR Password1[15];
|
||||||
WCHAR Password2[15];
|
TCHAR Password2[15];
|
||||||
DWORD Length;
|
DWORD Length;
|
||||||
LPNMHDR lpnm;
|
LPNMHDR lpnm;
|
||||||
|
|
||||||
|
@ -439,12 +437,12 @@ ComputerPageDlgProc(HWND hwndDlg,
|
||||||
GetComputerName(ComputerName, &Length);
|
GetComputerName(ComputerName, &Length);
|
||||||
|
|
||||||
/* Display current computer name */
|
/* Display current computer name */
|
||||||
SetDlgItemTextW(hwndDlg, IDC_COMPUTERNAME, ComputerName);
|
SetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName);
|
||||||
|
|
||||||
/* Set text limits */
|
/* Set text limits */
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_COMPUTERNAME, EM_LIMITTEXT, 64, 0);
|
SendDlgItemMessage(hwndDlg, IDC_COMPUTERNAME, EM_LIMITTEXT, 64, 0);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_ADMINPASSWORD1, EM_LIMITTEXT, 14, 0);
|
SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD1, EM_LIMITTEXT, 14, 0);
|
||||||
SendDlgItemMessageW(hwndDlg, IDC_ADMINPASSWORD2, EM_LIMITTEXT, 14, 0);
|
SendDlgItemMessage(hwndDlg, IDC_ADMINPASSWORD2, EM_LIMITTEXT, 14, 0);
|
||||||
|
|
||||||
/* Set focus to computer name */
|
/* Set focus to computer name */
|
||||||
SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME));
|
SetFocus(GetDlgItem(hwndDlg, IDC_COMPUTERNAME));
|
||||||
|
@ -466,10 +464,10 @@ ComputerPageDlgProc(HWND hwndDlg,
|
||||||
case PSN_WIZNEXT:
|
case PSN_WIZNEXT:
|
||||||
if (GetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName, 64) == 0)
|
if (GetDlgItemText(hwndDlg, IDC_COMPUTERNAME, ComputerName, 64) == 0)
|
||||||
{
|
{
|
||||||
MessageBoxW(hwndDlg,
|
MessageBox(hwndDlg,
|
||||||
L"Setup cannot continue until you enter the name of your computer.",
|
_T("Setup cannot continue until you enter the name of your computer."),
|
||||||
L"ReactOS Setup",
|
_T("ReactOS Setup"),
|
||||||
MB_ICONERROR | MB_OK);
|
MB_ICONERROR | MB_OK);
|
||||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -478,23 +476,23 @@ ComputerPageDlgProc(HWND hwndDlg,
|
||||||
|
|
||||||
if (!SetComputerName(ComputerName))
|
if (!SetComputerName(ComputerName))
|
||||||
{
|
{
|
||||||
MessageBoxW(hwndDlg,
|
MessageBox(hwndDlg,
|
||||||
L"Setup failed to set the computer name.",
|
_T("Setup failed to set the computer name."),
|
||||||
L"ReactOS Setup",
|
_T("ReactOS Setup"),
|
||||||
MB_ICONERROR | MB_OK);
|
MB_ICONERROR | MB_OK);
|
||||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check admin passwords */
|
/* Check admin passwords */
|
||||||
GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15);
|
GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD1, Password1, 15);
|
||||||
GetDlgItemTextW(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15);
|
GetDlgItemText(hwndDlg, IDC_ADMINPASSWORD2, Password2, 15);
|
||||||
if (wcscmp(Password1, Password2))
|
if (_tcscmp(Password1, Password2))
|
||||||
{
|
{
|
||||||
MessageBoxW(hwndDlg,
|
MessageBox(hwndDlg,
|
||||||
L"The passwords you entered do not match. Please enter "\
|
_T("The passwords you entered do not match. Please enter "\
|
||||||
"the desired password again.",
|
"the desired password again."),
|
||||||
L"ReactOS Setup",
|
_T("ReactOS Setup"),
|
||||||
MB_ICONERROR | MB_OK);
|
MB_ICONERROR | MB_OK);
|
||||||
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
SetWindowLong(hwndDlg, DWL_MSGRESULT, -1);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
@ -523,49 +521,49 @@ static VOID
|
||||||
SetKeyboardLayoutName(HWND hwnd)
|
SetKeyboardLayoutName(HWND hwnd)
|
||||||
{
|
{
|
||||||
#if 0
|
#if 0
|
||||||
WCHAR szLayoutPath[256];
|
TCHAR szLayoutPath[256];
|
||||||
WCHAR szLocaleName[32];
|
TCHAR szLocaleName[32];
|
||||||
DWORD dwLocaleSize;
|
DWORD dwLocaleSize;
|
||||||
HKEY hKey;
|
HKEY hKey;
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale",
|
_T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Locale"),
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&hKey))
|
&hKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dwValueSize = 16 * sizeof(WCHAR);
|
dwValueSize = 16 * sizeof(TCHAR);
|
||||||
if (RegQueryValueExW(hKey,
|
if (RegQueryValueEx(hKey,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
szLocaleName,
|
szLocaleName,
|
||||||
&dwLocaleSize))
|
&dwLocaleSize))
|
||||||
{
|
{
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wcscpy(szLayoutPath,
|
_tcscpy(szLayoutPath,
|
||||||
L"SYSTEM\\CurrentControlSet\\Control\\KeyboardLayouts\\"
|
_T("SYSTEM\\CurrentControlSet\\Control\\KeyboardLayouts\\"));
|
||||||
wcscat(szLayoutPath,
|
_tcscat(szLayoutPath,
|
||||||
szLocaleName);
|
szLocaleName);
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
szLayoutPath,
|
szLayoutPath,
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&hKey))
|
&hKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dwValueSize = 32 * sizeof(WCHAR);
|
dwValueSize = 32 * sizeof(TCHAR);
|
||||||
if (RegQueryValueExW(hKey,
|
if (RegQueryValueEx(hKey,
|
||||||
L"Layout Text",
|
_T("Layout Text"),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
szLocaleName,
|
szLocaleName,
|
||||||
&dwLocaleSize))
|
&dwLocaleSize))
|
||||||
{
|
{
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
return;
|
return;
|
||||||
|
@ -578,36 +576,36 @@ SetKeyboardLayoutName(HWND hwnd)
|
||||||
static VOID
|
static VOID
|
||||||
RunInputLocalePage(HWND hwnd)
|
RunInputLocalePage(HWND hwnd)
|
||||||
{
|
{
|
||||||
PROPSHEETPAGEW psp;
|
PROPSHEETPAGE psp;
|
||||||
PROPSHEETHEADERW psh;
|
PROPSHEETHEADER psh;
|
||||||
HMODULE hDll;
|
HMODULE hDll;
|
||||||
// WCHAR Caption[256];
|
// TCHAR Caption[256];
|
||||||
|
|
||||||
hDll = LoadLibraryW(L"intl.cpl");
|
hDll = LoadLibrary(_T("intl.cpl"));
|
||||||
if (hDll == NULL)
|
if (hDll == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
ZeroMemory(&psp, sizeof(PROPSHEETPAGEW));
|
ZeroMemory(&psp, sizeof(PROPSHEETPAGE));
|
||||||
psp.dwSize = sizeof(PROPSHEETPAGEW);
|
psp.dwSize = sizeof(PROPSHEETPAGE);
|
||||||
psp.dwFlags = PSP_DEFAULT;
|
psp.dwFlags = PSP_DEFAULT;
|
||||||
psp.hInstance = hDll;
|
psp.hInstance = hDll;
|
||||||
psp.pszTemplate = MAKEINTRESOURCEW(105); /* IDD_LOCALEPAGE from intl.cpl */
|
psp.pszTemplate = MAKEINTRESOURCE(105); /* IDD_LOCALEPAGE from intl.cpl */
|
||||||
psp.pfnDlgProc = GetProcAddress(hDll, "LocalePageProc");
|
psp.pfnDlgProc = GetProcAddress(hDll, "LocalePageProc");
|
||||||
|
|
||||||
// LoadString(hDll, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
|
// LoadString(hDll, IDS_CPLNAME, Caption, sizeof(Caption) / sizeof(TCHAR));
|
||||||
|
|
||||||
ZeroMemory(&psh, sizeof(PROPSHEETHEADERW));
|
ZeroMemory(&psh, sizeof(PROPSHEETHEADER));
|
||||||
psh.dwSize = sizeof(PROPSHEETHEADERW);
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
||||||
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
psh.dwFlags = PSH_PROPSHEETPAGE | PSH_PROPTITLE;
|
||||||
// psh.hwndParent = hwnd;
|
// psh.hwndParent = hwnd;
|
||||||
// psh.hInstance = hDll;
|
// psh.hInstance = hDll;
|
||||||
// psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
|
// psh.hIcon = LoadIcon(hApplet, MAKEINTRESOURCE(IDC_CPLICON));
|
||||||
psh.pszCaption = L"Title"; //Caption;
|
psh.pszCaption = _T("Title"); //Caption;
|
||||||
psh.nPages = 1;
|
psh.nPages = 1;
|
||||||
psh.nStartPage = 0;
|
psh.nStartPage = 0;
|
||||||
psh.ppsp = &psp;
|
psh.ppsp = &psp;
|
||||||
|
|
||||||
PropertySheetW(&psh);
|
PropertySheet(&psh);
|
||||||
|
|
||||||
FreeLibrary(hDll);
|
FreeLibrary(hDll);
|
||||||
}
|
}
|
||||||
|
@ -708,7 +706,7 @@ GetLargerTimeZoneEntry(PSETUPDATA SetupData, DWORD Index)
|
||||||
static VOID
|
static VOID
|
||||||
CreateTimeZoneList(PSETUPDATA SetupData)
|
CreateTimeZoneList(PSETUPDATA SetupData)
|
||||||
{
|
{
|
||||||
WCHAR szKeyName[256];
|
TCHAR szKeyName[256];
|
||||||
DWORD dwIndex;
|
DWORD dwIndex;
|
||||||
DWORD dwNameSize;
|
DWORD dwNameSize;
|
||||||
DWORD dwValueSize;
|
DWORD dwValueSize;
|
||||||
|
@ -719,33 +717,33 @@ CreateTimeZoneList(PSETUPDATA SetupData)
|
||||||
PTIMEZONE_ENTRY Entry;
|
PTIMEZONE_ENTRY Entry;
|
||||||
PTIMEZONE_ENTRY Current;
|
PTIMEZONE_ENTRY Current;
|
||||||
|
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones",
|
_T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"),
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&hZonesKey))
|
&hZonesKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
dwIndex = 0;
|
dwIndex = 0;
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
dwNameSize = 256;
|
dwNameSize = 256 * sizeof(TCHAR);
|
||||||
lError = RegEnumKeyExW(hZonesKey,
|
lError = RegEnumKeyEx(hZonesKey,
|
||||||
dwIndex,
|
dwIndex,
|
||||||
szKeyName,
|
szKeyName,
|
||||||
&dwNameSize,
|
&dwNameSize,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
NULL);
|
NULL);
|
||||||
if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA)
|
if (lError != ERROR_SUCCESS && lError != ERROR_MORE_DATA)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (RegOpenKeyExW(hZonesKey,
|
if (RegOpenKeyEx(hZonesKey,
|
||||||
szKeyName,
|
szKeyName,
|
||||||
0,
|
0,
|
||||||
KEY_ALL_ACCESS,
|
KEY_ALL_ACCESS,
|
||||||
&hZoneKey))
|
&hZoneKey))
|
||||||
break;
|
break;
|
||||||
|
|
||||||
Entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TIMEZONE_ENTRY));
|
Entry = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(TIMEZONE_ENTRY));
|
||||||
|
@ -755,61 +753,61 @@ CreateTimeZoneList(PSETUPDATA SetupData)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwValueSize = 64 * sizeof(WCHAR);
|
dwValueSize = 64 * sizeof(TCHAR);
|
||||||
if (RegQueryValueExW(hZoneKey,
|
if (RegQueryValueEx(hZoneKey,
|
||||||
L"Display",
|
_T("Display"),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(LPBYTE)&Entry->Description,
|
(LPBYTE)&Entry->Description,
|
||||||
&dwValueSize))
|
&dwValueSize))
|
||||||
|
{
|
||||||
|
RegCloseKey(hZoneKey);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
dwValueSize = 32 * sizeof(TCHAR);
|
||||||
|
if (RegQueryValueEx(hZoneKey,
|
||||||
|
_T("Std"),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
(LPBYTE)&Entry->StandardName,
|
||||||
|
&dwValueSize))
|
||||||
{
|
{
|
||||||
RegCloseKey(hZoneKey);
|
RegCloseKey(hZoneKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwValueSize = 32 * sizeof(WCHAR);
|
dwValueSize = 32 * sizeof(WCHAR);
|
||||||
if (RegQueryValueExW(hZoneKey,
|
if (RegQueryValueEx(hZoneKey,
|
||||||
L"Std",
|
_T("Dlt"),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(LPBYTE)&Entry->StandardName,
|
(LPBYTE)&Entry->DaylightName,
|
||||||
&dwValueSize))
|
&dwValueSize))
|
||||||
{
|
|
||||||
RegCloseKey(hZoneKey);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
dwValueSize = 32 * sizeof(WCHAR);
|
|
||||||
if (RegQueryValueExW(hZoneKey,
|
|
||||||
L"Dlt",
|
|
||||||
NULL,
|
|
||||||
NULL,
|
|
||||||
(LPBYTE)&Entry->DaylightName,
|
|
||||||
&dwValueSize))
|
|
||||||
{
|
{
|
||||||
RegCloseKey(hZoneKey);
|
RegCloseKey(hZoneKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwValueSize = sizeof(DWORD);
|
dwValueSize = sizeof(DWORD);
|
||||||
if (RegQueryValueExW(hZoneKey,
|
if (RegQueryValueEx(hZoneKey,
|
||||||
L"Index",
|
_T("Index"),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(LPBYTE)&Entry->Index,
|
(LPBYTE)&Entry->Index,
|
||||||
&dwValueSize))
|
&dwValueSize))
|
||||||
{
|
{
|
||||||
RegCloseKey(hZoneKey);
|
RegCloseKey(hZoneKey);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dwValueSize = sizeof(TZ_INFO);
|
dwValueSize = sizeof(TZ_INFO);
|
||||||
if (RegQueryValueExW(hZoneKey,
|
if (RegQueryValueEx(hZoneKey,
|
||||||
L"TZI",
|
_T("TZI"),
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
(LPBYTE)&Entry->TimezoneInfo,
|
(LPBYTE)&Entry->TimezoneInfo,
|
||||||
&dwValueSize))
|
&dwValueSize))
|
||||||
{
|
{
|
||||||
RegCloseKey(hZoneKey);
|
RegCloseKey(hZoneKey);
|
||||||
break;
|
break;
|
||||||
|
@ -886,27 +884,136 @@ DestroyTimeZoneList(PSETUPDATA SetupData)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
static BOOL
|
||||||
|
GetTimeZoneListIndex(LPDWORD lpIndex)
|
||||||
|
{
|
||||||
|
TCHAR szLanguageIdString[9];
|
||||||
|
HKEY hKey;
|
||||||
|
DWORD dwValueSize;
|
||||||
|
DWORD Length;
|
||||||
|
LPTSTR Buffer;
|
||||||
|
LPTSTR Ptr;
|
||||||
|
LPTSTR End;
|
||||||
|
BOOL bFound;
|
||||||
|
|
||||||
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
|
_T("SYSTEM\\CurrentControlSet\\Control\\NLS\\Language"),
|
||||||
|
0,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&hKey))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
dwValueSize = 9 * sizeof(TCHAR);
|
||||||
|
if (RegQueryValueEx(hKey,
|
||||||
|
_T("Default"),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
(LPBYTE)szLanguageIdString,
|
||||||
|
&dwValueSize))
|
||||||
|
{
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
|
_T("SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Time Zones"),
|
||||||
|
0,
|
||||||
|
KEY_ALL_ACCESS,
|
||||||
|
&hKey))
|
||||||
|
return FALSE;
|
||||||
|
|
||||||
|
dwValueSize = 0;
|
||||||
|
if (RegQueryValueEx(hKey,
|
||||||
|
_T("IndexMapping"),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
&dwValueSize))
|
||||||
|
{
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, dwValueSize);
|
||||||
|
if (Buffer == NULL)
|
||||||
|
{
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (RegQueryValueEx(hKey,
|
||||||
|
_T("IndexMapping"),
|
||||||
|
NULL,
|
||||||
|
NULL,
|
||||||
|
(LPBYTE)Buffer,
|
||||||
|
&dwValueSize))
|
||||||
|
{
|
||||||
|
HeapFree(GetProcessHeap(), 0, Buffer);
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
RegCloseKey(hKey);
|
||||||
|
|
||||||
|
Ptr = Buffer;
|
||||||
|
while (*Ptr != 0)
|
||||||
|
{
|
||||||
|
Length = _tcslen(Ptr);
|
||||||
|
if (_tcsicmp(Ptr, szLanguageIdString) == 0)
|
||||||
|
bFound = TRUE;
|
||||||
|
|
||||||
|
Ptr = Ptr + Length + 1;
|
||||||
|
if (*Ptr == 0)
|
||||||
|
break;
|
||||||
|
|
||||||
|
Length = _tcslen(Ptr);
|
||||||
|
|
||||||
|
if (bFound)
|
||||||
|
{
|
||||||
|
*lpIndex = _tcstoul(Ptr, &End, 10);
|
||||||
|
HeapFree(GetProcessHeap(), 0, Buffer);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
Ptr = Ptr + Length + 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
HeapFree(GetProcessHeap(), 0, Buffer);
|
||||||
|
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static VOID
|
static VOID
|
||||||
ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData)
|
ShowTimeZoneList(HWND hwnd, PSETUPDATA SetupData)
|
||||||
{
|
{
|
||||||
PTIMEZONE_ENTRY Entry;
|
PTIMEZONE_ENTRY Entry;
|
||||||
|
DWORD dwIndex = 0;
|
||||||
|
DWORD dwEntryIndex = 0;
|
||||||
|
DWORD dwCount;
|
||||||
|
|
||||||
|
GetTimeZoneListIndex(&dwEntryIndex);
|
||||||
|
|
||||||
Entry = SetupData->TimeZoneListHead;
|
Entry = SetupData->TimeZoneListHead;
|
||||||
while (Entry != NULL)
|
while (Entry != NULL)
|
||||||
{
|
{
|
||||||
SendMessageW(hwnd,
|
dwCount = SendMessage(hwnd,
|
||||||
CB_ADDSTRING,
|
CB_ADDSTRING,
|
||||||
0,
|
0,
|
||||||
(LPARAM)Entry->Description);
|
(LPARAM)Entry->Description);
|
||||||
|
|
||||||
|
if (dwEntryIndex != 0 && dwEntryIndex == Entry->Index)
|
||||||
|
dwIndex = dwCount;
|
||||||
|
|
||||||
Entry = Entry->Next;
|
Entry = Entry->Next;
|
||||||
}
|
}
|
||||||
|
|
||||||
SendMessageW(hwnd,
|
SendMessage(hwnd,
|
||||||
CB_SETCURSEL,
|
CB_SETCURSEL,
|
||||||
(WPARAM)0, // index
|
(WPARAM)dwIndex,
|
||||||
0);
|
0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -934,10 +1041,10 @@ SetLocalTimeZone(HWND hwnd, PSETUPDATA SetupData)
|
||||||
Entry = Entry->Next;
|
Entry = Entry->Next;
|
||||||
}
|
}
|
||||||
|
|
||||||
wcscpy(TimeZoneInformation.StandardName,
|
_tcscpy(TimeZoneInformation.StandardName,
|
||||||
Entry->StandardName);
|
Entry->StandardName);
|
||||||
wcscpy(TimeZoneInformation.DaylightName,
|
_tcscpy(TimeZoneInformation.DaylightName,
|
||||||
Entry->DaylightName);
|
Entry->DaylightName);
|
||||||
|
|
||||||
TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
|
TimeZoneInformation.Bias = Entry->TimezoneInfo.Bias;
|
||||||
TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
|
TimeZoneInformation.StandardBias = Entry->TimezoneInfo.StandardBias;
|
||||||
|
@ -992,19 +1099,19 @@ SetAutoDaylightInfo(HWND hwnd)
|
||||||
|
|
||||||
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED)
|
if (SendMessage(hwnd, BM_GETCHECK, 0, 0) == BST_UNCHECKED)
|
||||||
{
|
{
|
||||||
if (RegOpenKeyExW(HKEY_LOCAL_MACHINE,
|
if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
|
||||||
L"SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation",
|
_T("SYSTEM\\CurrentControlSet\\Control\\TimeZoneInformation"),
|
||||||
0,
|
0,
|
||||||
KEY_SET_VALUE,
|
KEY_SET_VALUE,
|
||||||
&hKey))
|
&hKey))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
RegSetValueExW(hKey,
|
RegSetValueEx(hKey,
|
||||||
L"DisableAutoDaylightTimeSet",
|
_T("DisableAutoDaylightTimeSet"),
|
||||||
0,
|
0,
|
||||||
REG_DWORD,
|
REG_DWORD,
|
||||||
(LPBYTE)&dwValue,
|
(LPBYTE)&dwValue,
|
||||||
sizeof(DWORD));
|
sizeof(DWORD));
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue