2 * Copyright 2003, 2004, 2005 Martin Fuchs
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.
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.
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
21 // Explorer and Desktop clone
25 // Martin Fuchs, 16.08.2003
29 //#include "shellhook.h"
32 #define CLASSNAME_TASKBAR TEXT("MSTaskSwWClass")
33 #define TITLE_TASKBAR TEXT("Running Applications")
35 #define IDC_FIRST_APP 0x2000
37 //#define TASKBAR_AT_TOP
39 #define TASKBUTTONWIDTH_MIN 38
40 #define TASKBUTTONWIDTH_MAX 160
43 #define IDW_TASKTOOLBAR 100
46 #define PM_GET_LAST_ACTIVE (WM_APP+0x1D)
49 /// internal task bar button management entry
54 int _id
; // ID for WM_COMMAND
63 /// map for managing the task bar buttons, mapped by application window handle
64 struct TaskBarMap
: public map
<HWND
, TaskBarEntry
>
68 iterator
find_id(int id
);
73 struct TaskBar
: public Window
80 static HWND
Create(HWND hwndParent
);
83 WindowHandle _htoolbar
;
86 WindowHandle _last_foreground_wnd
;
88 MINIMIZEDMETRICS _mmMetrics_org
;
90 const UINT WM_SHELLHOOK
;
92 LRESULT
Init(LPCREATESTRUCT pcs
);
93 LRESULT
WndProc(UINT nmsg
, WPARAM wparam
, LPARAM lparam
);
94 int Command(int id
, int code
);
95 int Notify(int id
, NMHDR
* pnmh
);
97 void ActivateApp(TaskBarMap::iterator it
, bool can_minimize
=true, bool can_restore
=true);
98 void ShowAppSystemMenu(TaskBarMap::iterator it
);
100 static BOOL CALLBACK
EnumWndProc(HWND hwnd
, LPARAM lparam
);
103 void ResizeButtons();