[REGEDIT]

- Allow canceling import operations. Patch by Lee Schroeder.
CORE-6766 #resolve

svn path=/trunk/; revision=57773
This commit is contained in:
Thomas Faber 2012-11-28 11:20:13 +00:00
parent 5c4631ef0b
commit f8de4142cd
2 changed files with 18 additions and 3 deletions

View file

@ -213,7 +213,7 @@ int APIENTRY wWinMain(HINSTANCE hInstance,
/* Perform application initialization */
if (!InitInstance(hInstance, nCmdShow))
{
return FALSE;
return 0;
}
hAccel = LoadAcceleratorsW(hInstance, MAKEINTRESOURCEW(ID_ACCEL));

View file

@ -158,10 +158,25 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent)
/* Request import confirmation */
if (!silent)
{
int choice;
LoadStringW(hInst, IDS_IMPORT_PROMPT, szText, COUNT_OF(szText));
if (InfoMessageBox(NULL, MB_YESNO | MB_ICONWARNING, szTitle, szText, filename) != IDYES)
goto cont;
choice = InfoMessageBox(NULL, MB_YESNOCANCEL | MB_ICONWARNING, szTitle, szText, filename);
switch (choice)
{
case IDNO:
goto cont;
case IDCANCEL:
/* The cancel case is useful if the user is importing more than one registry file
at a time, and wants to back out anytime during the import process. This way, the
user doesn't have to resort to ending the regedit process abruptly just to cancel
the operation. */
return TRUE;
default:
break;
}
}
/* Open the file */