#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);
bacMenu::~bacMenu()
{
// Remove the tray icon
- SendTrayMsg(NIM_DELETE, 0);
+ DelTrayIcon();
// Destroy the loaded menu
if (m_hmenu != NULL)
void
bacMenu::UpdateTrayIcon(int bacstat)
{
- (void *)bac_status(NULL, 0);
+ (void)bac_status(NULL, 0);
SendTrayMsg(NIM_MODIFY, bacstat);
}
// 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();
_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);
}
case WM_CLOSE:
+ if (bacService::RunningAsService()) {
+ _this->DelTrayIcon();
+ }
terminate_filed(0);
break;