-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.10 2006/09/23 13:26:38 roro 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
* <locka@iol.ie>
* or write to the Free Software Foundation, Inc., 59
* Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * Revisions :
- * $Log: w32taskbar.c,v $
- *
*********************************************************************/
-\f
+
#include "config.h"
#include <stdio.h>
+#ifndef STRICT
+#define STRICT
+#endif
#include <windows.h>
#include "w32taskbar.h"
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);
*
* 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
HWND CreateTrayWindow(HINSTANCE hInstance)
{
WNDCLASS wc;
- static const char *szWndName = "JunkbusterTrayWindow";
+ static const char *szWndName = "PrivoxyTrayWindow";
wc.style = 0;
wc.lpfnWndProc = TrayProc;
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 );
case WM_TRAYMSG:
{
- UINT uID = (UINT) wParam;
+ /* UINT uID = (UINT) wParam; */
UINT uMouseMsg = (UINT) lParam;
if (uMouseMsg == WM_RBUTTONDOWN)
return 0;
default:
- /* DO NOTHING */
+
+ if (msg == g_traycreatedmsg)
+ {
+ TrayAddIcon(g_hwndTrayX, 1, g_hiconApp, "Privoxy");
+ }
break;
}
}
+#endif /* ndef _WIN_CONSOLE - entire file */
+
/*
Local Variables:
tab-width: 3