X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=w32taskbar.c;h=c17e4d1aebcb2faeecfc075053c1fd472a0796e7;hp=ae08843d94ab0f6b118becd3225a4391e842cb51;hb=fdd604f3e302996f8d647720eef9f45d9070340e;hpb=4556222a07fe07c2efad678013a66eac670c4296 diff --git a/w32taskbar.c b/w32taskbar.c index ae08843d..c17e4d1a 100644 --- a/w32taskbar.c +++ b/w32taskbar.c @@ -1,4 +1,4 @@ -const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1.1.1 2001/05/15 13:59:08 oes Exp $"; +const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.10 2006/09/23 13:26:38 roro Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $ @@ -6,8 +6,8 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1.1.1 2001/05/15 13:59:08 o * 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 * @@ -30,19 +30,16 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1.1.1 2001/05/15 13:59:08 o * or write to the Free Software Foundation, Inc., 59 * Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - * Revisions : - * $Log: w32taskbar.c,v $ - * Revision 1.1.1.1 2001/05/15 13:59:08 oes - * Initial import of version 2.9.3 source tree - * - * *********************************************************************/ - + #include "config.h" #include +#ifndef STRICT +#define STRICT +#endif #include #include "w32taskbar.h" @@ -50,13 +47,14 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.1.1.1 2001/05/15 13:59:08 o #include "w32log.h" const char w32taskbar_h_rcs[] = W32TASKBAR_H_VERSION; - -#ifndef _WIN_CONSOLE /* entire file */ + +#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); @@ -65,7 +63,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 @@ -76,7 +75,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; @@ -91,6 +90,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 ); @@ -231,7 +233,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) @@ -251,7 +253,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; } @@ -260,8 +266,8 @@ LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) } -#endif /* ndef _WIN_CONSOLE - entire file */ - +#endif /* ndef _WIN_CONSOLE - entire file */ + /* Local Variables: tab-width: 3