Reorganizing the repository: swapping out what was HEAD (the old 3.1 branch)
[privoxy.git] / w32taskbar.c
similarity index 91%
rename from src/w32taskbar.c
rename to w32taskbar.c
index a963bc0..bc35db8 100644 (file)
@@ -1,7 +1,7 @@
-const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 2.0 2002/06/04 14:34:21 jongfoster Exp $";
+const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 1.7.2.2 2003/03/19 21:27:42 gliptak Exp $";
 /*********************************************************************
  *
- * File        :  $Source: /cvsroot/ijbswa/current/src/w32taskbar.c,v $
+ * File        :  $Source: /cvsroot/ijbswa/current/Attic/w32taskbar.c,v $
  *
  * Purpose     :  Functions for creating, setting and destroying the
  *                workspace tray icon
@@ -32,8 +32,12 @@ const char w32taskbar_rcs[] = "$Id: w32taskbar.c,v 2.0 2002/06/04 14:34:21 jongf
  *
  * Revisions   :
  *    $Log: w32taskbar.c,v $
- *    Revision 2.0  2002/06/04 14:34:21  jongfoster
- *    Moving source files to src/
+ *    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.
@@ -77,20 +81,11 @@ const char w32taskbar_h_rcs[] = W32TASKBAR_H_VERSION;
 
 #ifndef _WIN_CONSOLE /* entire file */
 
-/**
- * Our custom message ID.
- */
 #define WM_TRAYMSG WM_USER+1
 
-/**
- * The menu handle for the tray icon's pop-up menu.
- */
 static HMENU g_hmenuTray;
-
-/**
- * The invisible window responsible for processing tray messages.
- */
 static HWND g_hwndTrayX;
+static UINT g_traycreatedmsg;
 
 static LRESULT CALLBACK TrayProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
 
@@ -126,6 +121,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 );
@@ -286,7 +284,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;
    }