*** empty log message ***
[desktopswitcher.git] / switcherwindow.h
blobadb89db8c6bda7242b85c4a3182226229723c00d
1 // $Id: switcherwindow.h,v 1.2 2002/06/29 15:03:33 nedko Exp $
2 //
3 // Desktop Switcher
4 // Copyright (C) 2000,2001,2002 Nedko Arnaudov <nedko@users.sourceforge.net>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 #ifndef _SWITCHER_WINDOW_H_f8ade2f7_4bdf_4b29_9e91_fd26a09ff35d__INCLUDED
21 #define _SWITCHER_WINDOW_H_f8ade2f7_4bdf_4b29_9e91_fd26a09ff35d__INCLUDED
23 #include "switcher.h"
24 #include "ShadowWindow.h"
25 class CDesktopSwitcher;
26 class CDesktop;
28 // Preparation for the function we want to import from USER32.DLL
29 typedef BOOL (WINAPI *lpfnUpdateLayeredWindow)(HWND hwnd, // handle to layered window
30 HDC hdcDst, // handle to screen DC
31 POINT *pptDst, // new screen position
32 SIZE *psize, // new size of the layered window
33 HDC hdcSrc, // handle to surface DC
34 POINT *pptSrc, // layer position
35 COLORREF crKey, // color key
36 BLENDFUNCTION *pblend, // blend function
37 DWORD dwFlags); // options
39 class CSwitcherWindow : public CWindowImpl <CSwitcherWindow>
41 public:
42 CSwitcherWindow(CDesktopSwitcher *pDesktopSwitcher, CDesktop *pDesktop);
43 ~CSwitcherWindow();
44 BOOL Create();
45 void Destroy();
46 void ToggleVisible();
47 void OnRun();
48 void DrawWindow();
50 BEGIN_MSG_MAP(CSwitcherWindow)
51 MESSAGE_HANDLER(WM_CLOSE,OnClose)
52 MESSAGE_HANDLER(WM_HOTKEY,OnHotKey)
53 MESSAGE_HANDLER(WM_NCRBUTTONDOWN,OnRButtonDown)
54 MESSAGE_HANDLER(WM_EXITSIZEMOVE,OnExitSizeMove)
55 MESSAGE_HANDLER(WM_NCHITTEST,OnNCHitText)
56 COMMAND_ID_HANDLER(ID_RUN,OnRun)
57 COMMAND_ID_HANDLER(ID_EXIT,OnExit)
58 END_MSG_MAP()
60 protected:
61 LRESULT OnClose(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
62 LRESULT OnHotKey(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
63 LRESULT OnRButtonDown(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
64 LRESULT OnExitSizeMove(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
65 LRESULT OnNCHitText(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
67 LRESULT OnRun(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
68 LRESULT OnExit(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
70 private:
71 CDesktopSwitcher *m_pDesktopSwitcher;
72 CDesktop *m_pDesktop;
74 CShadowWindow *m_pMoveWnd;
75 POINT m_ptMoveBegin;
77 HBITMAP m_hBackground;
79 HDC m_hdcMemory;
82 #endif // #ifndef _SWITCHER_WINDOW_H_f8ade2f7_4bdf_4b29_9e91_fd26a09ff35d__INCLUDED