|
|
|
@ -771,7 +771,13 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) |
|
|
|
if (p) *p = 0; |
|
|
|
if (p) *p = 0; |
|
|
|
if (!strncmp(line + 1, "restart", 7)) |
|
|
|
if (!strncmp(line + 1, "restart", 7)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (FindWindowW(L"Shell_TrayWnd", NULL)) |
|
|
|
HWND hShellTrayWnd = FindWindowW(L"Shell_TrayWnd", NULL); |
|
|
|
|
|
|
|
if (hShellTrayWnd) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
WCHAR wszPath[MAX_PATH]; |
|
|
|
|
|
|
|
ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR)); |
|
|
|
|
|
|
|
INT64 res = -1; |
|
|
|
|
|
|
|
if (!SendMessageTimeoutW(hShellTrayWnd, 1460, 0, 0, SMTO_ABORTIFHUNG, 2000, &res) && res) |
|
|
|
{ |
|
|
|
{ |
|
|
|
HANDLE hExplorerRestartThread = CreateThread(NULL, 0, BeginExplorerRestart, NULL, 0, NULL); |
|
|
|
HANDLE hExplorerRestartThread = CreateThread(NULL, 0, BeginExplorerRestart, NULL, 0, NULL); |
|
|
|
if (hExplorerRestartThread) |
|
|
|
if (hExplorerRestartThread) |
|
|
|
@ -786,8 +792,6 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) |
|
|
|
} |
|
|
|
} |
|
|
|
Sleep(100); |
|
|
|
Sleep(100); |
|
|
|
//ZZRestartExplorer(0, 0, 0, 0);
|
|
|
|
//ZZRestartExplorer(0, 0, 0, 0);
|
|
|
|
WCHAR wszPath[MAX_PATH]; |
|
|
|
|
|
|
|
ZeroMemory(wszPath, MAX_PATH * sizeof(WCHAR)); |
|
|
|
|
|
|
|
GetSystemDirectoryW(wszPath, MAX_PATH); |
|
|
|
GetSystemDirectoryW(wszPath, MAX_PATH); |
|
|
|
wcscat_s(wszPath, MAX_PATH, L"\\taskkill.exe"); |
|
|
|
wcscat_s(wszPath, MAX_PATH, L"\\taskkill.exe"); |
|
|
|
ShellExecuteW( |
|
|
|
ShellExecuteW( |
|
|
|
@ -798,6 +802,7 @@ static BOOL GUI_Build(HDC hDC, HWND hwnd, POINT pt) |
|
|
|
NULL, |
|
|
|
NULL, |
|
|
|
SW_SHOWMINIMIZED |
|
|
|
SW_SHOWMINIMIZED |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
} |
|
|
|
GetWindowsDirectoryW(wszPath, MAX_PATH); |
|
|
|
GetWindowsDirectoryW(wszPath, MAX_PATH); |
|
|
|
wcscat_s(wszPath, MAX_PATH, L"\\explorer.exe"); |
|
|
|
wcscat_s(wszPath, MAX_PATH, L"\\explorer.exe"); |
|
|
|
Sleep(1000); |
|
|
|
Sleep(1000); |
|
|
|
|