From 215623574e21eba00255143c616d637db3a70a60 Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 19 Sep 2012 16:28:18 +0000 Subject: added waiting ehile miranda close database git-svn-id: http://svn.miranda-ng.org/main/trunk@1605 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/ProfileManager/src/pmanagerEx.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index f90fc26a9c..4bda7e2363 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -69,9 +69,14 @@ static INT_PTR LoadPM(WPARAM wParam, LPARAM lParam) static INT_PTR CheckDb(WPARAM wParam, LPARAM lParam) { if (MessageBox( 0, TranslateT("Miranda NG will exit and Database checker will start.\n\nAre you sure you want to do this?"), TranslateT("Check Database"), MB_ICONWARNING | MB_YESNO | MB_DEFBUTTON2 ) == IDYES) { - GetModuleFileName(GetModuleHandle(NULL), fn, SIZEOF(fn)); + TCHAR mirandaPath[MAX_PATH], cmdLine[100]; + PROCESS_INFORMATION pi; + STARTUPINFO si = {0}; + si.cb = sizeof(si); + GetModuleFileName(NULL, mirandaPath, SIZEOF(mirandaPath)); + mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /svc:dbchecker"), mirandaPath, GetCurrentProcessId()); CallService("CloseAction", 0, 0); - ShellExecute(0, _T("open"), fn, _T("/svc:dbchecker"), _T(""), 1); + CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi); } return 0; } -- cgit v1.2.3