X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=w32log.c;h=c524ffa246c4e1794d4a334e5aba909b4b994b6b;hp=b0f3c62081a43ec56b224a88e1c64abd461406dc;hb=1a723fce2e34538ed80b695803089d1c8b8f456f;hpb=0428133610c525457cb16f7ac6a54203a2743d6c diff --git a/w32log.c b/w32log.c index b0f3c620..c524ffa2 100644 --- a/w32log.c +++ b/w32log.c @@ -1,4 +1,4 @@ -const char w32log_rcs[] = "$Id: w32log.c,v 1.39 2011/05/27 11:34:16 fabiankeil Exp $"; +const char w32log_rcs[] = "$Id: w32log.c,v 1.48 2012/05/27 15:45:05 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32log.c,v $ @@ -641,7 +641,7 @@ HWND CreateHiddenLogOwnerWindow(HINSTANCE hInstance) hwnd = CreateWindow(szWndName, szWndName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - CW_USEDEFAULT, NULL, NULL, hInstance, NULL ); + CW_USEDEFAULT, NULL, NULL, hInstance, NULL); return hwnd; @@ -724,8 +724,8 @@ HWND CreateLogWindow(HINSTANCE hInstance, int nCmdShow) /* SendMessage(g_hwndLogBox, EM_SETWORDWRAPMODE, 0, 0); */ /* Subclass the control to catch certain messages */ - g_fnLogBox = (WNDPROC) GetWindowLong(g_hwndLogBox, GWL_WNDPROC); - SetWindowLong(g_hwndLogBox, GWL_WNDPROC, (LONG) LogRichEditProc); + g_fnLogBox = (WNDPROC) GetWindowLongPtr(g_hwndLogBox, GWLP_WNDPROC); + SetWindowLongPtr(g_hwndLogBox, GWLP_WNDPROC, (LONG_PTR) LogRichEditProc); /* Minimizing looks stupid when the log window is not on the task bar, so hide instead */ if (!g_bShowOnTaskBar && @@ -944,18 +944,17 @@ void OnLogCommand(int nCommand) break; #ifdef FEATURE_TOGGLE - /* by haroon - change toggle to its opposite value */ case ID_TOGGLE_ENABLED: global_toggle_state = !global_toggle_state; - if (global_toggle_state) - { - log_error(LOG_LEVEL_INFO, "Now toggled ON."); - } - else - { - log_error(LOG_LEVEL_INFO, "Now toggled OFF."); - } - SetIdleIcon(); + log_error(LOG_LEVEL_INFO, + "Now toggled %s", global_toggle_state ? "ON" : "OFF"); + /* + * Leverage TIMER_ANIMSTOP_ID to set the idle icon through the + * "application queue". According to MSDN, 10 milliseconds are + * the lowest value possible and seem to be close enough to + * "instantly". + */ + SetTimer(g_hwndLogFrame, TIMER_ANIMSTOP_ID, 10, NULL); break; #endif /* def FEATURE_TOGGLE */ @@ -1111,7 +1110,6 @@ void SetIdleIcon() if (!global_toggle_state) { TraySetIcon(g_hwndTray, 1, g_hiconOff); - /* log_error(LOG_LEVEL_INFO, "Privoxy OFF icon selected."); */ } else #endif /* def FEATURE_TOGGLE */ @@ -1184,7 +1182,7 @@ LRESULT CALLBACK LogWindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lPara return 0; case WM_CLOSE: - /* This is the end - beautiful friend - the end */ + /* This is the end - my only friend - the end */ DestroyWindow(g_hwndLogBox); DestroyWindow(g_hwndLogFrame); return 0;