summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-09-19 16:28:18 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-09-19 16:28:18 +0000
commit215623574e21eba00255143c616d637db3a70a60 (patch)
tree01ffd5e695f2011d7f3dea8a6e8ffe594855fc33
parentefaf8aa8ece4518fa9912175d29d291a5ad6c06f (diff)
added waiting ehile miranda close database
git-svn-id: http://svn.miranda-ng.org/main/trunk@1605 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/ProfileManager/src/pmanagerEx.cpp9
1 files changed, 7 insertions, 2 deletions
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;
}