diff options
author | Robert Pösel <robyer@seznam.cz> | 2013-06-14 11:46:49 +0000 |
---|---|---|
committer | Robert Pösel <robyer@seznam.cz> | 2013-06-14 11:46:49 +0000 |
commit | 5e54283e7ab71e94e7df98253a00c53c6d470e77 (patch) | |
tree | cf4c3f3b424dcf865b12a48bb745fcfdf361634d | |
parent | 986c890a4362d01a9fd3fb102723b7125546302a (diff) |
Fixed Cancel button on Restarting dialog
git-svn-id: http://svn.miranda-ng.org/main/trunk@4930 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | src/core/miranda.cpp | 10 | ||||
-rw-r--r-- | src/core/modules.cpp | 4 | ||||
-rw-r--r-- | src/resource.rc | 4 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/core/miranda.cpp b/src/core/miranda.cpp index 4af88f95a6..20d841f528 100644 --- a/src/core/miranda.cpp +++ b/src/core/miranda.cpp @@ -187,25 +187,27 @@ static INT_PTR CALLBACK WaitForProcessDlgProc(HWND hwnd, UINT msg, WPARAM wParam break;
case WM_COMMAND:
- if ( HIWORD(wParam) == IDCANCEL) {
+ if ( LOWORD(wParam) == IDCANCEL) {
SendDlgItemMessage(hwnd, IDC_PROGRESSBAR, PBM_SETPOS, MIRANDA_PROCESS_WAIT_STEPS, 0);
- EndDialog(hwnd, 0);
+ EndDialog(hwnd, 1);
}
break;
}
return FALSE;
}
-void CheckRestart()
+int CheckRestart()
{
+ int result = 0;
LPCTSTR tszPID = CmdLine_GetOption( _T("restart"));
if (tszPID) {
HANDLE hProcess = OpenProcess(SYNCHRONIZE, FALSE, _ttol(tszPID));
if (hProcess) {
- DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_WAITRESTART), NULL, WaitForProcessDlgProc, (LPARAM)hProcess);
+ result = DialogBoxParam(hInst, MAKEINTRESOURCE(IDD_WAITRESTART), NULL, WaitForProcessDlgProc, (LPARAM)hProcess);
CloseHandle(hProcess);
}
}
+ return result;
}
static void crtErrorHandler(const wchar_t*, const wchar_t*, const wchar_t*, unsigned, uintptr_t)
diff --git a/src/core/modules.cpp b/src/core/modules.cpp index b36a6812cc..cc1e59b113 100644 --- a/src/core/modules.cpp +++ b/src/core/modules.cpp @@ -29,7 +29,7 @@ static DWORD mainThreadId; static HANDLE hMainThread;
static HANDLE hMissingService;
-void CheckRestart(); // core: IDD_WAITRESTART
+int CheckRestart(); // core: IDD_WAITRESTART
int LoadSystemModule(void); // core: m_system.h services
int LoadNewPluginsModuleInfos(void); // core: preloading plugins
@@ -95,7 +95,7 @@ int LoadDefaultModules(void) //load order is very important for these
if ( LoadSystemModule()) return 1;
if ( LoadLangpackModule()) return 1; // langpack will be a system module in the new order so this is moved here
- CheckRestart();
+ if ( CheckRestart()) return 1;
if ( LoadUtilsModule()) return 1; //order not important for this, but no dependencies and no point in pluginising
if ( LoadIcoTabsModule()) return 1;
if ( LoadHeaderbarModule()) return 1;
diff --git a/src/resource.rc b/src/resource.rc index fc0e7b0ff9..9dba2c9672 100644 --- a/src/resource.rc +++ b/src/resource.rc @@ -52,7 +52,7 @@ BEGIN COMBOBOX IDC_GROUP,112,16,110,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
CONTROL "Send ""You were added""",IDC_ADDED,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,44,204,10
CONTROL "Send authorization request",IDC_AUTH,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,56,204,10
- CONTROL "Open contact's chat window",IDC_OPEN_WINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,68,204,10
+ CONTROL "Open contact's chat window",IDC_OPEN_WINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,68,204,10
LTEXT "Custom name:",IDC_STATIC,6,4,70,10
LTEXT "Group:",IDC_STATIC,112,4,70,10
GROUPBOX "Options",IDC_STATIC,7,33,216,48
@@ -604,7 +604,7 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1 BEGIN
LTEXT "Miranda NG is being restarted.\nPlease wait...",IDC_STATIC,7,7,153,18
CONTROL "",IDC_PROGRESSBAR,"msctls_progress32",WS_BORDER,7,30,153,14
- PUSHBUTTON "Close",IDCANCEL,110,49,50,14
+ PUSHBUTTON "Cancel",IDCANCEL,110,49,50,14
END
IDD_ERROR_LIST DIALOGEX 0, 0, 312, 209
|