| 1 | /* | 
|---|
| 2 | * synergy -- mouse and keyboard sharing utility | 
|---|
| 3 | * Copyright (C) 2003 Chris Schoeneman | 
|---|
| 4 | * | 
|---|
| 5 | * This package is free software; you can redistribute it and/or | 
|---|
| 6 | * modify it under the terms of the GNU General Public License | 
|---|
| 7 | * found in the file COPYING that should have accompanied this file. | 
|---|
| 8 | * | 
|---|
| 9 | * This package is distributed in the hope that it will be useful, | 
|---|
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 12 | * GNU General Public License for more details. | 
|---|
| 13 | */ | 
|---|
| 14 |  | 
|---|
| 15 | #ifndef CMSWINDOWSSERVERTASKBARRECEIVER_H | 
|---|
| 16 | #define CMSWINDOWSSERVERTASKBARRECEIVER_H | 
|---|
| 17 |  | 
|---|
| 18 | #define WIN32_LEAN_AND_MEAN | 
|---|
| 19 |  | 
|---|
| 20 | #include "CServerTaskBarReceiver.h" | 
|---|
| 21 | #include <windows.h> | 
|---|
| 22 |  | 
|---|
| 23 | class CBufferedLogOutputter; | 
|---|
| 24 |  | 
|---|
| 25 | //! Implementation of CServerTaskBarReceiver for Microsoft Windows | 
|---|
| 26 | class CMSWindowsServerTaskBarReceiver : public CServerTaskBarReceiver { | 
|---|
| 27 | public: | 
|---|
| 28 | CMSWindowsServerTaskBarReceiver(HINSTANCE, const CBufferedLogOutputter*); | 
|---|
| 29 | virtual ~CMSWindowsServerTaskBarReceiver(); | 
|---|
| 30 |  | 
|---|
| 31 | // IArchTaskBarReceiver overrides | 
|---|
| 32 | virtual void            showStatus(); | 
|---|
| 33 | virtual void            runMenu(int x, int y); | 
|---|
| 34 | virtual void            primaryAction(); | 
|---|
| 35 | virtual const Icon      getIcon() const; | 
|---|
| 36 |  | 
|---|
| 37 | protected: | 
|---|
| 38 | void                            copyLog() const; | 
|---|
| 39 |  | 
|---|
| 40 | // CServerTaskBarReceiver overrides | 
|---|
| 41 | virtual void            onStatusChanged(); | 
|---|
| 42 |  | 
|---|
| 43 | private: | 
|---|
| 44 | HICON                           loadIcon(UINT); | 
|---|
| 45 | void                            deleteIcon(HICON); | 
|---|
| 46 | void                            createWindow(); | 
|---|
| 47 | void                            destroyWindow(); | 
|---|
| 48 |  | 
|---|
| 49 | BOOL                            dlgProc(HWND hwnd, | 
|---|
| 50 | UINT msg, WPARAM wParam, LPARAM lParam); | 
|---|
| 51 | static BOOL CALLBACK | 
|---|
| 52 | staticDlgProc(HWND hwnd, | 
|---|
| 53 | UINT msg, WPARAM wParam, LPARAM lParam); | 
|---|
| 54 |  | 
|---|
| 55 | private: | 
|---|
| 56 | HINSTANCE                       m_appInstance; | 
|---|
| 57 | HWND                            m_window; | 
|---|
| 58 | HMENU                           m_menu; | 
|---|
| 59 | HICON                           m_icon[kMaxState]; | 
|---|
| 60 | const CBufferedLogOutputter*    m_logBuffer; | 
|---|
| 61 | static const UINT       s_stateToIconID[]; | 
|---|
| 62 | }; | 
|---|
| 63 |  | 
|---|
| 64 | #endif | 
|---|