diff --git a/reactos/base/applications/regedit/main.c b/reactos/base/applications/regedit/main.c index acb8a7b8a0b..ea37f8ab3ae 100644 --- a/reactos/base/applications/regedit/main.c +++ b/reactos/base/applications/regedit/main.c @@ -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)); diff --git a/reactos/base/applications/regedit/regedit.c b/reactos/base/applications/regedit/regedit.c index 8d9ee80dee2..af456d8b7fd 100644 --- a/reactos/base/applications/regedit/regedit.c +++ b/reactos/base/applications/regedit/regedit.c @@ -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 */