]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/win32/libwin32/wintray.cpp
kes Add context menu for floating a window.
[bacula/bacula] / bacula / src / win32 / libwin32 / wintray.cpp
index ee866f4a3b24e662ab136761eb14f169af3e7979..ca70e5164f5d2416cb5ab3f53022e6e5ea2dfb26 100644 (file)
@@ -48,9 +48,6 @@ const UINT MENU_DEFAULT_PROPERTIES_SHOW = RegisterWindowMessage("Bacula.Properti
 #endif
 const UINT MENU_ABOUTBOX_SHOW = RegisterWindowMessage("Bacula.AboutBox.Show");
 const UINT MENU_STATUS_SHOW = RegisterWindowMessage("Bacula.Status.Show");
-const UINT MENU_EVENTS_SHOW = RegisterWindowMessage("Bacula.Events.Show");
-const UINT MENU_SERVICEHELPER_MSG = RegisterWindowMessage("Bacula.ServiceHelper.Message");
-const UINT MENU_ADD_CLIENT_MSG = RegisterWindowMessage("Bacula.AddClient.Message");
 const char *MENU_CLASS_NAME = "BaculaFD Tray Icon";
 
 extern void terminate_filed(int sig);
@@ -116,7 +113,7 @@ bacMenu::bacMenu()
 bacMenu::~bacMenu()
 {
    // Remove the tray icon
-   SendTrayMsg(NIM_DELETE, 0);
+   DelTrayIcon();
         
    // Destroy the loaded menu
    if (m_hmenu != NULL)
@@ -139,7 +136,7 @@ bacMenu::DelTrayIcon()
 void
 bacMenu::UpdateTrayIcon(int bacstat)
 {
-   (void *)bac_status(NULL, 0);
+   (void)bac_status(NULL, 0);
    SendTrayMsg(NIM_MODIFY, bacstat);
 }
 
@@ -218,7 +215,6 @@ LRESULT CALLBACK bacMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
 
    // Every five seconds, a timer message causes the icon to update
    case WM_TIMER:
-      // *** HACK for running servicified
       if (bacService::RunningAsService()) {
           // Attempt to add the icon if it's not already there
           _this->AddTrayIcon();
@@ -241,17 +237,6 @@ LRESULT CALLBACK bacMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
          _this->UpdateTrayIcon(bacstat);
          break;
 
-      case ID_EVENTS:
-         // Show the Events dialog
-         _this->m_events.Show(TRUE);
-         _this->UpdateTrayIcon(bacstat);
-         break;
-
-
-      case ID_KILLCLIENTS:
-         // Disconnect all currently connected clients
-         break;
-
       case ID_ABOUT:
          // Show the About box
          _this->m_about.Show(TRUE);
@@ -311,6 +296,9 @@ LRESULT CALLBACK bacMenu::WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lP
       }
 
    case WM_CLOSE:
+      if (bacService::RunningAsService()) {
+          _this->DelTrayIcon();
+      }
       terminate_filed(0);
       break;