diff options
author | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-29 06:47:37 +0000 |
---|---|---|
committer | Kirill Volinsky <mataes2007@gmail.com> | 2013-01-29 06:47:37 +0000 |
commit | 4a38e2b5de9f41f8bb3fa74457f98b2b69b9d56c (patch) | |
tree | 16f6eb44c346276721a92d257a7f9fc3779e1d5e /src/modules/utils | |
parent | 55d1905cffff485f577d49654a18362cbcfb61ec (diff) |
added ability to restart with current profile
git-svn-id: http://svn.miranda-ng.org/main/trunk@3328 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src/modules/utils')
-rw-r--r-- | src/modules/utils/utils.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/modules/utils/utils.cpp b/src/modules/utils/utils.cpp index a672074ed7..4f165bbd6c 100644 --- a/src/modules/utils/utils.cpp +++ b/src/modules/utils/utils.cpp @@ -420,14 +420,19 @@ static INT_PTR RestoreWindowPosition(WPARAM wParam, LPARAM lParam) }
/////////////////////////////////////////////////////////////////////////////////////////
-static INT_PTR RestartMiranda(WPARAM, LPARAM)
+static INT_PTR RestartMiranda(WPARAM wParam, LPARAM)
{
- TCHAR mirandaPath[ MAX_PATH ], cmdLine[ 100 ];
+ TCHAR mirandaPath[MAX_PATH], cmdLine[100];
PROCESS_INFORMATION pi;
- STARTUPINFO si = { 0 };
+ STARTUPINFO si = {0};
si.cb = sizeof(si);
GetModuleFileName(NULL, mirandaPath, SIZEOF(mirandaPath));
- mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
+ if (wParam) {
+ TCHAR *profilename = Utils_ReplaceVarsT(_T("%miranda_profilename%"));
+ mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d /profile=%s"), mirandaPath, GetCurrentProcessId(), profilename);
+ mir_free(profilename);
+ } else
+ mir_sntprintf(cmdLine, SIZEOF(cmdLine), _T("\"%s\" /restart:%d"), mirandaPath, GetCurrentProcessId());
CallService("CloseAction", 0, 0);
CreateProcess(mirandaPath, cmdLine, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
return 0;
|