X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=w32taskbar.c;h=0b9ebba7d73c78890cb42dad05ec754e62da7929;hp=62f269d0124b3c4fcec86977ed13b032928eba52;hb=7bfb6887ab00db9e025508bff29c122f05a63ace;hpb=c75584ebcc79f939fb4ec9c8f842cef6692640c7 diff --git a/w32taskbar.c b/w32taskbar.c index 62f269d0..0b9ebba7 100644 --- a/w32taskbar.c +++ b/w32taskbar.c @@ -1,13 +1,13 @@ -const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1 2001/05/13 21:57:07 administrator Exp $"; +const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.9 2006/07/18 14:48:48 david__schmidt Exp $"; /********************************************************************* * - * File : $Source: /home/administrator/cvs/ijb/w32taskbar.c,v $ + * File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $ * * Purpose : Functions for creating, setting and destroying the * workspace tray icon * - * Copyright : Written by and Copyright (C) 2001 the SourceForge - * IJBSWA team. http://ijbswa.sourceforge.net + * Copyright : Written by and Copyright (C) 2001-2002 members of + * the Privoxy team. http://www.privoxy.org/ * * Written by and Copyright (C) 1999 Adam Lock * @@ -32,6 +32,38 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1 2001/05/13 21:57:07 admin * * Revisions : * $Log: w32taskbar.c,v $ + * Revision 1.9 2006/07/18 14:48:48 david__schmidt + * Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch) + * with what was really the latest development (the v_3_0_branch branch) + * + * Revision 1.7.2.2 2003/03/19 21:27:42 gliptak + * Corrected compilation error/typo + * + * Revision 1.7.2.1 2002/11/20 14:39:32 oes + * Applied patch by Mattes Dolak which adds re-creation of the win32 taskbar + * icon on reception of the "TaskbarCreated" window message. + * + * Revision 1.7 2002/03/31 17:19:00 jongfoster + * Win32 only: Enabling STRICT to fix a VC++ compile warning. + * + * Revision 1.6 2002/03/26 22:57:10 jongfoster + * Web server name should begin www. + * + * Revision 1.5 2002/03/24 12:03:47 jongfoster + * Name change + * + * Revision 1.4 2001/11/16 00:46:31 jongfoster + * Fixing compiler warnings + * + * Revision 1.3 2001/05/22 18:56:28 oes + * CRLF -> LF + * + * Revision 1.2 2001/05/20 15:07:54 jongfoster + * File is now ignored if _WIN_CONSOLE is defined. + * + * Revision 1.1.1.1 2001/05/15 13:59:08 oes + * Initial import of version 2.9.3 source tree + * * *********************************************************************/ @@ -40,6 +72,9 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1 2001/05/13 21:57:07 admin #include +#ifndef STRICT +#define STRICT +#endif #include #include "w32taskbar.h" @@ -48,10 +83,13 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1 2001/05/13 21:57:07 admin const char w32taskbar_h_rcs[] = W32TASKBAR_H_VERSION; +#ifndef _WIN_CONSOLE /* entire file */ + #define WM_TRAYMSG WM_USER+1 static HMENU g_hmenuTray; static HWND g_hwndTrayX; +static UINT g_traycreatedmsg; static LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -60,7 +98,8 @@ static LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar * * Function : CreateTrayWindow * - * Description : Creates and returns the invisible window responsible for processing tray messages. + * Description : Creates and returns the invisible window responsible + * for processing tray messages. * * Parameters : * 1 : hInstance = instance handle of this application @@ -71,7 +110,7 @@ static LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar HWND CreateTrayWindow(HINSTANCE hInstance) { WNDCLASS wc; - static const char *szWndName = "JunkbusterTrayWindow"; + static const char *szWndName = "PrivoxyTrayWindow"; wc.style = 0; wc.lpfnWndProc = TrayProc; @@ -86,6 +125,9 @@ HWND CreateTrayWindow(HINSTANCE hInstance) RegisterClass(&wc); + /* TaskbarCreated is sent to a window when it should re-add its tray icons */ + g_traycreatedmsg = RegisterWindowMessage("TaskbarCreated"); + g_hwndTrayX = CreateWindow(szWndName, szWndName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstance, NULL ); @@ -226,7 +268,7 @@ LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) case WM_TRAYMSG: { - UINT uID = (UINT) wParam; + /* UINT uID = (UINT) wParam; */ UINT uMouseMsg = (UINT) lParam; if (uMouseMsg == WM_RBUTTONDOWN) @@ -246,7 +288,11 @@ LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) return 0; default: - /* DO NOTHING */ + + if (msg == g_traycreatedmsg) + { + TrayAddIcon(g_hwndTrayX, 1, g_hiconApp, "Privoxy"); + } break; } @@ -255,6 +301,8 @@ LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } +#endif /* ndef _WIN_CONSOLE - entire file */ + /* Local Variables: tab-width: 3