X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=w32taskbar.c;h=a485db0f58347bd8179178b1f1ae26d3a7f419ec;hb=4b42cab8889ffd0a8a4dd65c159bd942893954bd;hp=63ac0d35398928634677b7aef2971933e95bc633;hpb=6d1554928803b8cceb91a8e82de8ae3418c896f4;p=privoxy.git diff --git a/w32taskbar.c b/w32taskbar.c index 63ac0d35..a485db0f 100644 --- a/w32taskbar.c +++ b/w32taskbar.c @@ -1,4 +1,4 @@ -const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.2 2001/05/20 15:07:54 jongfoster Exp $"; +const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.11 2009/05/16 13:27:20 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/w32taskbar.c,v $ @@ -6,13 +6,13 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.2 2001/05/20 15:07:54 jongf * 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 * * - * This program is free software; you can redistribute it + * This program is free software; you can redistribute it * and/or modify it under the terms of the GNU General * Public License as published by the Free Software * Foundation; either version 2 of the License, or (at @@ -30,22 +30,16 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.2 2001/05/20 15:07:54 jongf * 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.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 - * - * *********************************************************************/ - + #include "config.h" #include +#ifndef STRICT +#define STRICT +#endif #include #include "w32taskbar.h" @@ -60,6 +54,7 @@ const char w32taskbar_h_rcs[] = W32TASKBAR_H_VERSION; static HMENU g_hmenuTray; static HWND g_hwndTrayX; +static UINT g_traycreatedmsg; static LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam); @@ -68,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 @@ -79,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; @@ -94,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 ); @@ -234,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) @@ -254,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; }