diff --git a/reactos/base/applications/regedit/main.c b/reactos/base/applications/regedit/main.c index 09c7668b2ba..e8cdc025617 100644 --- a/reactos/base/applications/regedit/main.c +++ b/reactos/base/applications/regedit/main.c @@ -196,26 +196,25 @@ int APIENTRY wWinMain(HINSTANCE hInstance, UNREFERENCED_PARAMETER(hPrevInstance); + /* Initialize global strings */ + LoadStringW(hInstance, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); + LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, COUNT_OF(szFrameClass)); + LoadStringW(hInstance, IDC_REGEDIT, szChildClass, COUNT_OF(szChildClass)); + if (ProcessCmdLine(lpCmdLine)) { return 0; } - /* Initialize global strings */ - LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); - LoadStringW(hInstance, IDC_REGEDIT_FRAME, szFrameClass, MAX_LOADSTRING); - LoadStringW(hInstance, IDC_REGEDIT, szChildClass, MAX_LOADSTRING); - - switch (GetUserDefaultUILanguage()) - { - case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): - SetProcessDefaultLayout(LAYOUT_RTL); - break; + { + case MAKELANGID(LANG_HEBREW, SUBLANG_DEFAULT): + SetProcessDefaultLayout(LAYOUT_RTL); + break; - default: - break; - } + default: + break; + } /* Store instance handle in our global variable */ hInst = hInstance; diff --git a/reactos/base/applications/regedit/regedit.c b/reactos/base/applications/regedit/regedit.c index 4601427fb46..5f553d8bdf2 100644 --- a/reactos/base/applications/regedit/regedit.c +++ b/reactos/base/applications/regedit/regedit.c @@ -138,7 +138,7 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent) { case ACTION_ADD: { - WCHAR szTitle[512], szText[512]; + WCHAR szText[512]; WCHAR filename[MAX_PATH]; FILE *fp; @@ -146,12 +146,10 @@ BOOL PerformRegAction(REGEDIT_ACTION action, LPWSTR s, BOOL silent) if (!filename[0]) { InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified."); - InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage); exit(4); } - LoadStringW(hInst, IDS_APP_TITLE, szTitle, COUNT_OF(szTitle)); - while (filename[0]) { /* Request import confirmation */ @@ -217,7 +215,7 @@ cont: if (!reg_key_name[0]) { InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No registry key is specified for removal."); - InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage); exit(6); } delete_registry_key(reg_key_name); @@ -233,7 +231,7 @@ cont: if (!filename[0]) { InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, L"No file name is specified."); - InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage); exit(7); } @@ -318,7 +316,7 @@ BOOL ProcessCmdLine(LPWSTR lpCmdLine) action = ACTION_EXPORT; break; case L'?': - InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, NULL, usage); + InfoMessageBox(NULL, MB_OK | MB_ICONINFORMATION, szTitle, usage); exit(3); break; default: