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  // quicklaunch.h
24  //
25  // Martin Fuchs, 22.08.2003
26  //
27 
28 
29 #define	QUICKLAUNCH_WIDTH_DEF	70
30 #define	QUICKLAUNCH_WIDTH_DEF	70
31 
32 #define	IDW_QUICKLAUNCHBAR	101
33 
34 #define	PM_UPDATE_DESKTOP	(WM_APP+0x23)
35 
36 #define	IDC_FIRST_QUICK_ID	0x4000
37 
38 
39 #define	QUICKLAUNCH_FOLDER	TEXT("Microsoft\\Internet Explorer\\Quick Launch")
40 
41 
42  /// quick launch bar shortcut
43 struct QuickLaunchEntry
44 {
45 	QuickLaunchEntry();
46 
47 	HBITMAP	_hbmp;
48 	String	_title;
49 	Entry*	_entry;
50 };
51 
52  /// map for managing the task bar buttons
53 struct QuickLaunchMap : public map<int, QuickLaunchEntry>
54 {
55 	~QuickLaunchMap();
56 };
57 
58 
59  /// quick launch bar window
60 struct QuickLaunchBar : public ExtContextMenuHandlerT<SubclassedWindow>
61 {
62 	typedef ExtContextMenuHandlerT<SubclassedWindow> super;
63 
64 	QuickLaunchBar(HWND hwnd);
65 	~QuickLaunchBar();
66 
67 	static HWND	Create(HWND hwndParent);
68 
69 protected:
70 	LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam);
71 	int		Command(int id, int code);
72 	int		Notify(int id, NMHDR* pnmh);
73 
74 	ShellDirectory*	_dir;
75 
76 	int				_next_id;
77 	QuickLaunchMap	_entries;
78 	int				_btn_dist;
79 	int				_size;
80 
81 	void	AddShortcuts();
82 	void	AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry* entry, int flags=TBSTATE_ENABLED);
83 	void	UpdateDesktopButtons(int desktop_idx);
84 };
85