Fix bugs about range request and explorer crashes

1. fix a bug that when header contains "Range: 100-", the range request
support will fail
2. (windows) fix a bug that when explorer.exe crashes due to some
reason, the tray icon will disappear.
This commit is contained in:
Jay
2013-02-25 22:17:46 +08:00
parent 7931929a42
commit 690eff4fa2
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -690,6 +690,7 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
char buf[200], *service_argv[] = {__argv[0], NULL};
POINT pt;
HMENU hMenu;
static UINT s_uTaskbarRestart; // for taskbar creation
switch (msg) {
case WM_CREATE:
@@ -700,6 +701,7 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
exit(EXIT_SUCCESS);
} else {
start_mongoose(__argc, __argv);
s_uTaskbarRestart = RegisterWindowMessage(TEXT("TaskbarCreated"));
}
break;
case WM_COMMAND:
@@ -757,6 +759,9 @@ static LRESULT CALLBACK WindowProc(HWND hWnd, UINT msg, WPARAM wParam,
Shell_NotifyIcon(NIM_DELETE, &TrayIcon);
PostQuitMessage(0);
return 0; // We've just sent our own quit message, with proper hwnd.
default:
if (msg==s_uTaskbarRestart)
Shell_NotifyIcon(NIM_ADD, &TrayIcon);
}
return DefWindowProc(hWnd, msg, wParam, lParam);