- Fix formatting

svn path=/trunk/; revision=33049
This commit is contained in:
Dmitry Chapyshev
2008-04-20 07:57:28 +00:00
parent 0a8d3f23bc
commit 6061afd624
2 changed files with 39 additions and 39 deletions
+24 -24
View File
@@ -39,34 +39,34 @@ SelectLayoutByLang(VOID)
static VOID
AddNewLayout(HWND hwndDlg)
{
TCHAR NewLayout[3];
INT iLayout;
HKEY hKey;
DWORD cValues;
PTSTR pts;
TCHAR NewLayout[3];
INT iLayout;
HKEY hKey;
DWORD cValues;
PTSTR pts;
iLayout = SendMessage(hLayoutList, CB_GETCURSEL, 0, 0);
if (iLayout == CB_ERR) return;
iLayout = SendMessage(hLayoutList, CB_GETCURSEL, 0, 0);
if (iLayout == CB_ERR) return;
if (RegOpenKey(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"), &hKey) == ERROR_SUCCESS)
{
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &cValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
_stprintf(NewLayout, _T("%d"), cValues + 1);
if (RegOpenKey(HKEY_CURRENT_USER, _T("Keyboard Layout\\Preload"), &hKey) == ERROR_SUCCESS)
{
if (RegQueryInfoKey(hKey, NULL, NULL, NULL, NULL, NULL, NULL, &cValues, NULL, NULL, NULL, NULL) == ERROR_SUCCESS)
{
_stprintf(NewLayout, _T("%d"), cValues + 1);
pts = (PTSTR) SendMessage(hLayoutList, CB_GETITEMDATA, iLayout, 0);
pts = (PTSTR) SendMessage(hLayoutList, CB_GETITEMDATA, iLayout, 0);
if (RegSetValueEx(hKey,
NewLayout,
0,
REG_SZ,
(LPBYTE)pts,
(DWORD)(_tcslen(pts)*sizeof(PTSTR))) == ERROR_SUCCESS)
{
UpdateLayoutsList();
}
}
}
if (RegSetValueEx(hKey,
NewLayout,
0,
REG_SZ,
(LPBYTE)pts,
(DWORD)(_tcslen(pts)*sizeof(PTSTR))) == ERROR_SUCCESS)
{
UpdateLayoutsList();
}
}
}
}
VOID
+15 -15
View File
@@ -167,20 +167,20 @@ InitLangList(HWND hWnd)
VOID
UpdateLayoutsList(VOID)
{
(VOID) ListView_DeleteAllItems(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST));
InitLangList(MainDlgWnd);
(VOID) ListView_DeleteAllItems(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST));
InitLangList(MainDlgWnd);
}
static VOID
DeleteLayout(VOID)
{
INT iIndex;
INT iIndex;
iIndex = (INT) SendMessage(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST), LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
if (iIndex != -1)
{
MessageBox(0, _T("Not implemented!"), NULL, MB_OK);
}
iIndex = (INT) SendMessage(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST), LVM_GETNEXTITEM, -1, LVNI_FOCUSED);
if (iIndex != -1)
{
MessageBox(0, _T("Not implemented!"), NULL, MB_OK);
}
}
/* Property page dialog callback */
@@ -193,10 +193,10 @@ SettingPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
{
case WM_INITDIALOG:
{
MainDlgWnd = hwndDlg;
AddListColumn(hwndDlg);
(VOID) ListView_SetExtendedListViewStyle(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST),
LVS_EX_FULLROWSELECT);
MainDlgWnd = hwndDlg;
AddListColumn(hwndDlg);
(VOID) ListView_SetExtendedListViewStyle(GetDlgItem(MainDlgWnd, IDC_KEYLAYOUT_LIST),
LVS_EX_FULLROWSELECT);
InitLangList(hwndDlg);
EnableWindow(GetDlgItem(hwndDlg, IDC_PROP_BUTTON),FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_SET_DEFAULT),FALSE);
@@ -213,9 +213,9 @@ SettingPageProc(HWND hwndDlg,UINT uMsg,WPARAM wParam,LPARAM lParam)
case WM_COMMAND:
switch (LOWORD(wParam))
{
case IDC_REMOVE_BUTTON:
DeleteLayout();
break;
case IDC_REMOVE_BUTTON:
DeleteLayout();
break;
case IDC_KEY_SET_BTN:
DialogBox(hApplet,