ReactOS  0.4.14-dev-50-g13bb5e2
taskbar.h
Go to the documentation of this file.
1 /*
2  * Copyright 2003, 2004, 2005 Martin Fuchs
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library 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 GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17  */
18 
19 
20  //
21  // Explorer and Desktop clone
22  //
23  // taskbar.h
24  //
25  // Martin Fuchs, 16.08.2003
26  //
27 
28 
29 //#include "shellhook.h"
30 
31 
32 #define CLASSNAME_TASKBAR TEXT("MSTaskSwWClass")
33 #define TITLE_TASKBAR TEXT("Running Applications")
34 
35 #define IDC_FIRST_APP 0x2000
36 
37 //#define TASKBAR_AT_TOP
38 
39 #define TASKBUTTONWIDTH_MIN 38
40 #define TASKBUTTONWIDTH_MAX 160
41 
42 
43 #define IDW_TASKTOOLBAR 100
44 
45 
46 #define PM_GET_LAST_ACTIVE (WM_APP+0x1D)
47 
48 
51 {
52  TaskBarEntry();
53 
54  int _id; // ID for WM_COMMAND
56  int _bmp_idx;
57  int _used;
58  int _btn_idx;
61 };
62 
64 struct TaskBarMap : public map<HWND, TaskBarEntry>
65 {
66  ~TaskBarMap();
67 
68  iterator find_id(int id);
69 };
70 
71 
73 struct TaskBar : public Window
74 {
75  typedef Window super;
76 
77  TaskBar(HWND hwnd);
78  ~TaskBar();
79 
80  static HWND Create(HWND hwndParent);
81 
82 protected:
83  WindowHandle _htoolbar;
85  int _next_id;
86  WindowHandle _last_foreground_wnd;
89 
91 
94  int Command(int id, int code);
95  int Notify(int id, NMHDR* pnmh);
96 
97  void ActivateApp(TaskBarMap::iterator it, bool can_minimize=true, bool can_restore=true);
99 
101 
102  void Refresh();
103  void ResizeButtons();
104 };
int Notify(int id, NMHDR *pnmh)
Definition: taskbar.cpp:243
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
HBITMAP _hbmp
Definition: taskbar.h:55
~TaskBar()
Definition: taskbar.cpp:91
#define CALLBACK
Definition: compat.h:27
Window super
Definition: taskbar.h:75
iterator find_id(int id)
Definition: taskbar.cpp:561
static HWND Create(HWND hwndParent)
Definition: taskbar.cpp:107
const UINT WM_SHELLHOOK
Definition: taskbar.h:90
TaskBarMap _map
Definition: taskbar.h:84
int _bmp_idx
Definition: taskbar.h:56
static WCHAR String[]
Definition: stringtable.c:55
UINT_PTR WPARAM
Definition: windef.h:207
~TaskBarMap()
Definition: taskbar.cpp:60
WindowHandle _htoolbar
Definition: taskbar.h:83
void Refresh()
Definition: taskbar.cpp:488
Definition: window.c:29
unsigned int BOOL
Definition: ntddk_ex.h:94
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
Taskbar window.
Definition: taskbar.h:73
static HWND hwndParent
Definition: cryptui.c:300
LONG_PTR LPARAM
Definition: windef.h:208
void ResizeButtons()
Definition: taskbar.cpp:570
MINIMIZEDMETRICS _mmMetrics_org
Definition: taskbar.h:88
int _next_id
Definition: taskbar.h:85
int _btn_idx
Definition: taskbar.h:58
void ActivateApp(TaskBarMap::iterator it, bool can_minimize=true, bool can_restore=true)
Definition: taskbar.cpp:280
void ShowAppSystemMenu(TaskBarMap::iterator it)
Definition: taskbar.cpp:305
int _last_btn_width
Definition: taskbar.h:87
Definition: _map.h:44
internal task bar button management entry
Definition: taskbar.h:50
unsigned char BYTE
Definition: mem.h:68
int Command(int id, int code)
Definition: taskbar.cpp:231
WindowHandle _last_foreground_wnd
Definition: taskbar.h:86
static BOOL CALLBACK EnumWndProc(HWND hwnd, LPARAM lparam)
Definition: taskbar.cpp:374
String _title
Definition: taskbar.h:59
TaskBar(HWND hwnd)
Definition: taskbar.cpp:70
unsigned int UINT
Definition: ndis.h:50
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: taskbar.cpp:179
LRESULT Init(LPCREATESTRUCT pcs)
Definition: taskbar.cpp:119
int _used
Definition: taskbar.h:57
BYTE _fsState
Definition: taskbar.h:60
map for managing the task bar buttons, mapped by application window handle
Definition: taskbar.h:64
static HBITMAP
Definition: button.c:44
LONG_PTR LRESULT
Definition: windef.h:209
_Rep_type::iterator iterator
Definition: _map.h:85
static UINT WPARAM wparam
Definition: combo.c:716