mirror of
https://github.com/reactos/reactos.git
synced 2024-07-07 21:25:05 +00:00
Add message boxes to confirm the removal of user cursor schemes and the replacement of existing cursor schemes.
svn path=/trunk/; revision=26466
This commit is contained in:
parent
14dabcb80d
commit
84234a9add
|
@ -163,4 +163,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(systémové schéma)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -165,4 +165,9 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(Systemschema)"
|
||||
IDS_BROWSE_FILTER "Cursor (*.ani, *.cur)\0*.ani;*.cur\0Animierte Cursor (*.ani)\0*.ani\0Statische Cursor (*.cur)\0*.cur\0Alle Dateien\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Durchsuchen"
|
||||
IDS_REMOVE_TITLE "Löschen des Cursorschemas bestätigen"
|
||||
IDS_REMOVE_TEXT "Soll das Cursorschema '%s' wirklich gelöscht werden?"
|
||||
IDS_OVERWRITE_TITLE "Cursorschema überscheiben"
|
||||
IDS_OVERWRITE_TEXT "Ein Cursorschema mit diesem Namen existiert bereits. Möchen Sie das existierende Cursorschema überscheiben?"
|
||||
END
|
||||
|
||||
|
|
|
@ -163,4 +163,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Cursor Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -164,4 +164,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -164,4 +164,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(Arrangement système)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -164,4 +164,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -163,4 +163,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(skema sistem)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -165,4 +165,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(Schema di sistema)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -163,4 +163,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -162,4 +162,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -169,4 +169,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(schemat systemu)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -164,4 +164,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(system scheme)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -171,4 +171,8 @@ BEGIN
|
|||
IDS_SYSTEM_SCHEME "(ñèñòåìíà ñõåìà)"
|
||||
IDS_BROWSE_FILTER "Cursors (*.ani, *.cur)\0*.ani;*.cur\0Animated Cursors (*.ani)\0*.ani\0Static Cursors (*.cur)\0*.cur\0All Files\0*.*\0\0"
|
||||
IDS_BROWSE_TITLE "Browse"
|
||||
IDS_REMOVE_TITLE "Confirm Scheme Removal"
|
||||
IDS_REMOVE_TEXT "Are you sure you want to remove the cursor scheme '%s'?"
|
||||
IDS_OVERWRITE_TITLE "Confirm Cursor Scheme Overwrite"
|
||||
IDS_OVERWRITE_TEXT "The cursor scheme name you chose is already in use. Do you want to overwrite the existing cursor scheme?"
|
||||
END
|
||||
|
|
|
@ -568,6 +568,9 @@ static BOOL
|
|||
DeleteUserCursorScheme(HWND hwndDlg)
|
||||
{
|
||||
TCHAR szSchemeName[MAX_PATH];
|
||||
TCHAR szTitle[128];
|
||||
TCHAR szRawText[256];
|
||||
TCHAR szText[256];
|
||||
HWND hDlgCtrl;
|
||||
HKEY hCuKey;
|
||||
HKEY hCuCursorKey;
|
||||
|
@ -581,6 +584,15 @@ DeleteUserCursorScheme(HWND hwndDlg)
|
|||
|
||||
SendMessage(hDlgCtrl, CB_GETLBTEXT, nSel, (LPARAM)szSchemeName);
|
||||
|
||||
LoadString(hApplet, IDS_REMOVE_TITLE, szTitle, 128);
|
||||
LoadString(hApplet, IDS_REMOVE_TEXT, szRawText, 256);
|
||||
|
||||
_stprintf(szText, szRawText, szSchemeName);
|
||||
|
||||
/* Confirm scheme removal */
|
||||
if (MessageBox(hwndDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||||
return TRUE;
|
||||
|
||||
if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
|
@ -646,12 +658,18 @@ SaveCursorScheme(HWND hwndDlg)
|
|||
{
|
||||
TCHAR szSystemScheme[MAX_PATH];
|
||||
TCHAR szSchemeName[MAX_PATH];
|
||||
TCHAR szNewSchemeName[MAX_PATH];
|
||||
TCHAR szTitle[128];
|
||||
TCHAR szText[256];
|
||||
INT nSel;
|
||||
INT index, i, nLength;
|
||||
LPTSTR lpSchemeData;
|
||||
HKEY hCuKey;
|
||||
HKEY hCuCursorKey;
|
||||
LONG lResult = ERROR_SUCCESS;
|
||||
BOOL bSchemeExists;
|
||||
|
||||
LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
|
||||
|
||||
nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETCURSEL, 0, 0);
|
||||
if (nSel == CB_ERR)
|
||||
|
@ -663,56 +681,84 @@ SaveCursorScheme(HWND hwndDlg)
|
|||
}
|
||||
else
|
||||
{
|
||||
SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, nSel, (LPARAM)szSchemeName);
|
||||
SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, nSel, (LPARAM)szNewSchemeName);
|
||||
|
||||
LoadString(hApplet, IDS_SYSTEM_SCHEME, szSystemScheme, MAX_PATH);
|
||||
|
||||
if (_tcsstr(szSchemeName, szSystemScheme))
|
||||
if (_tcsstr(szNewSchemeName, szSystemScheme))
|
||||
{
|
||||
szSchemeName[_tcslen(szSchemeName) - _tcslen(szSystemScheme) - 1] = 0;
|
||||
szNewSchemeName[_tcslen(szNewSchemeName) - _tcslen(szSystemScheme) - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (DialogBoxParam(hApplet, MAKEINTRESOURCE(IDD_CURSOR_SCHEME_SAVEAS),
|
||||
hwndDlg, SaveSchemeProc, (LPARAM)szSchemeName))
|
||||
/* Ask for a name for the new cursor scheme */
|
||||
if (!DialogBoxParam(hApplet, MAKEINTRESOURCE(IDD_CURSOR_SCHEME_SAVEAS),
|
||||
hwndDlg, SaveSchemeProc, (LPARAM)szNewSchemeName))
|
||||
return TRUE;
|
||||
|
||||
/* Check all non-system schemes for the new name */
|
||||
nSel = SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETCOUNT, 0, 0);
|
||||
if (nSel == CB_ERR)
|
||||
return FALSE;
|
||||
|
||||
bSchemeExists = FALSE;
|
||||
for (i = 0; i < nSel; i++)
|
||||
{
|
||||
/* Save the cursor scheme */
|
||||
nLength = 0;
|
||||
for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
|
||||
SendDlgItemMessage(hwndDlg, IDC_COMBO_CURSOR_SCHEME, CB_GETLBTEXT, i, (LPARAM)szSchemeName);
|
||||
if (_tcsstr(szSchemeName, szSystemScheme) == NULL)
|
||||
{
|
||||
if (i > 0)
|
||||
nLength++;
|
||||
nLength += _tcslen(g_CursorData[i].szCursorPath);
|
||||
if (_tcscmp(szSchemeName, szNewSchemeName) == 0)
|
||||
{
|
||||
bSchemeExists = TRUE;
|
||||
break;
|
||||
}
|
||||
}
|
||||
nLength++;
|
||||
|
||||
lpSchemeData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(TCHAR));
|
||||
|
||||
for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
|
||||
{
|
||||
if (i > 0)
|
||||
_tcscat(lpSchemeData, _T(","));
|
||||
_tcscat(lpSchemeData, g_CursorData[i].szCursorPath);
|
||||
}
|
||||
|
||||
if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hCuKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
lResult = RegSetValueEx(hCuCursorKey, szSchemeName, 0, REG_EXPAND_SZ,
|
||||
(LPBYTE)lpSchemeData, nLength * sizeof(TCHAR));
|
||||
|
||||
RegCloseKey(hCuCursorKey);
|
||||
RegCloseKey(hCuKey);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpSchemeData);
|
||||
}
|
||||
|
||||
if (bSchemeExists)
|
||||
{
|
||||
LoadString(hApplet, IDS_OVERWRITE_TITLE, szTitle, 128);
|
||||
LoadString(hApplet, IDS_OVERWRITE_TEXT, szText, 256);
|
||||
|
||||
/* Confirm scheme overwrite */
|
||||
if (MessageBox(hwndDlg, szText, szTitle, MB_YESNO | MB_ICONQUESTION) == IDNO)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
/* Save the cursor scheme */
|
||||
nLength = 0;
|
||||
for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
|
||||
{
|
||||
if (i > 0)
|
||||
nLength++;
|
||||
nLength += _tcslen(g_CursorData[i].szCursorPath);
|
||||
}
|
||||
nLength++;
|
||||
|
||||
lpSchemeData = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, nLength * sizeof(TCHAR));
|
||||
|
||||
for (index = IDS_ARROW, i = 0; index <= IDS_HAND; index++, i++)
|
||||
{
|
||||
if (i > 0)
|
||||
_tcscat(lpSchemeData, _T(","));
|
||||
_tcscat(lpSchemeData, g_CursorData[i].szCursorPath);
|
||||
}
|
||||
|
||||
if (RegOpenCurrentUser(KEY_READ | KEY_SET_VALUE, &hCuKey) != ERROR_SUCCESS)
|
||||
return FALSE;
|
||||
|
||||
if (RegOpenKeyEx(hCuKey, _T("Control Panel\\Cursors\\Schemes"), 0, KEY_READ | KEY_SET_VALUE, &hCuCursorKey) != ERROR_SUCCESS)
|
||||
{
|
||||
RegCloseKey(hCuKey);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
lResult = RegSetValueEx(hCuCursorKey, szNewSchemeName, 0, REG_EXPAND_SZ,
|
||||
(LPBYTE)lpSchemeData, nLength * sizeof(TCHAR));
|
||||
|
||||
RegCloseKey(hCuCursorKey);
|
||||
RegCloseKey(hCuKey);
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, lpSchemeData);
|
||||
|
||||
return (lResult == ERROR_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,10 @@
|
|||
#define IDS_SYSTEM_SCHEME 1032
|
||||
#define IDS_BROWSE_FILTER 1033
|
||||
#define IDS_BROWSE_TITLE 1034
|
||||
|
||||
#define IDS_REMOVE_TITLE 1035
|
||||
#define IDS_REMOVE_TEXT 1036
|
||||
#define IDS_OVERWRITE_TITLE 1037
|
||||
#define IDS_OVERWRITE_TEXT 1038
|
||||
|
||||
#define IDC_SWAP_MOUSE_BUTTONS 2000
|
||||
#define IDC_SLIDER_DOUBLE_CLICK_SPEED 2001
|
||||
|
|
Loading…
Reference in a new issue