]> git.sur5r.net Git - bacula/bacula/blob - bacula/src/win32/libwin32/wintray.h
kes Add context menu for floating a window.
[bacula/bacula] / bacula / src / win32 / libwin32 / wintray.h
1 //  Copyright (C) 1999 AT&T Laboratories Cambridge. All Rights Reserved.
2 //
3 //  This file was part of the VNC system.
4 //
5 //  The VNC system is free software; you can redistribute it and/or modify
6 //  it under the terms of the GNU General Public License as published by
7 //  the Free Software Foundation; either version 2 of the License, or
8 //  (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307,
18 //  USA.
19 //
20 // If the source code for the VNC system is not available from the place
21 // whence you received this file, check http://www.uk.research.att.com/vnc or contact
22 // the authors on vnc@uk.research.att.com for information on obtaining it.
23 //
24 // This file has been adapted to the Win32 version of Bacula
25 // by Kern E. Sibbald.  Many thanks to ATT and James Weatherall,
26 // the original author, for providing an excellent template.
27 //
28 // Copyright (2000) Kern E. Sibbald
29 //
30
31
32
33 // winMenu
34
35 // This class handles creation of a system-tray icon & menu
36
37 class bacMenu;
38
39 #if (!defined(_win_bacMENU))
40 #define _win_bacMENU
41
42 #include "winabout.h"
43 #include "winstat.h"
44
45 // Constants
46 extern const UINT MENU_ABOUTBOX_SHOW;
47 extern const UINT MENU_STATUS_SHOW;
48 extern const char *MENU_CLASS_NAME;
49
50 // The tray menu class itself
51 class bacMenu
52 {
53 public:
54    bacMenu();
55    ~bacMenu();
56 protected:
57    // Tray icon handling
58    void AddTrayIcon();
59    void DelTrayIcon();
60    void UpdateTrayIcon(int battstat);
61    void SendTrayMsg(DWORD msg, int battstat);
62
63    // Message handler for the tray window
64    static LRESULT CALLBACK WndProc(HWND hwnd, UINT iMsg, WPARAM wParam, LPARAM lParam);
65
66    // Fields
67 protected:
68
69    // About dialog for this server
70    bacAbout  m_about;
71
72    // Status dialog for this server
73    bacStatus m_status;
74
75    HWND  m_hwnd;
76    HMENU m_hmenu;
77    NOTIFYICONDATA m_nid;
78
79    // The icon handles
80    HICON m_idle_icon;
81    HICON m_running_icon;
82    HICON m_error_icon;
83    HICON m_warn_icon;
84 };
85
86
87 #endif