ReactOS 0.4.15-dev-8207-gd73a838
QuickLaunchBar Struct Reference

quick launch bar window More...

#include <quicklaunch.h>

Inheritance diagram for QuickLaunchBar:
Collaboration diagram for QuickLaunchBar:

Public Types

typedef ExtContextMenuHandlerT< SubclassedWindowsuper
 
- Public Types inherited from ExtContextMenuHandlerT< SubclassedWindow >
typedef SubclassedWindow super
 
- Public Types inherited from SubclassedWindow
typedef Window super
 
- Public Types inherited from Window
typedef map< HWND, Window * > WindowMap
 
typedef Window *(* CREATORFUNC) (HWND)
 
typedef Window *(* CREATORFUNC_INFO) (HWND, const void *)
 

Public Member Functions

 QuickLaunchBar (HWND hwnd)
 
 ~QuickLaunchBar ()
 
- Public Member Functions inherited from ExtContextMenuHandlerT< SubclassedWindow >
 ExtContextMenuHandlerT (HWND hwnd)
 
 ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from SubclassedWindow
 SubclassedWindow (HWND)
 
- Public Member Functions inherited from Window
 Window (HWND hwnd)
 
virtual ~Window ()
 
LRESULT SendParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
LRESULT PostParent (UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
 
 Window (INT cx, INT cy, BOOL fAutoHide=FALSE)
 
virtual ~Window ()
 
virtual LRESULT CALLBACK WindowProcDx (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
void DoAction ()
 

Static Public Member Functions

static HWND Create (HWND hwndParent)
 
- Static Public Member Functions inherited from Window
static HWND Create (CREATORFUNC creator, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static HWND Create (CREATORFUNC_INFO creator, const void *info, DWORD dwExStyle, LPCTSTR lpClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int w, int h, HWND hwndParent=0, HMENU hMenu=0)
 
static Windowcreate_mdi_child (const ChildWndInfo &info, const MDICREATESTRUCT &mcs, CREATORFUNC_INFO creator)
 
static LRESULT CALLBACK WindowWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static INT_PTR CALLBACK DialogProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
static Windowget_window (HWND hwnd)
 get window controller from window handle
 
template<typename CLASS >
static CLASS * get_window (HWND hwnd)
 
static void register_pretranslate (HWND hwnd)
 
static void unregister_pretranslate (HWND hwnd)
 
static BOOL pretranslate_msg (LPMSG pmsg)
 
static void register_dialog (HWND hwnd)
 
static void unregister_dialog (HWND hwnd)
 
static BOOL dispatch_dialog_msg (LPMSG pmsg)
 
static int MessageLoop ()
 
static void CancelModes ()
 
static BOOL DoRegisterClass (HINSTANCE hInstance)
 
static HWND DoCreateMainWnd (HINSTANCE hInstance, LPCTSTR pszText, INT cx, INT cy, DWORD style=WS_POPUP|WS_THICKFRAME|WS_CLIPCHILDREN, DWORD exstyle=WS_EX_WINDOWEDGE|WS_EX_TOOLWINDOW|WS_EX_TOPMOST, BOOL fAutoHide=FALSE)
 
static INT DoMainLoop ()
 
static WindowGetAppbarData (HWND hwnd)
 
static LRESULT CALLBACK WindowProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static DWORD WINAPI ActionThreadFunc (LPVOID args)
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
int Notify (int id, NMHDR *pnmh)
 
void AddShortcuts ()
 
void AddButton (int id, HBITMAP hbmp, LPCTSTR name, Entry *entry, int flags=TBSTATE_ENABLED)
 
void UpdateDesktopButtons (int desktop_idx)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
- Protected Member Functions inherited from Window
virtual LRESULT Init (LPCREATESTRUCT pcs)
 
virtual LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual int Command (int id, int code)
 
virtual int Notify (int id, NMHDR *pnmh)
 
void OnCommand (HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
 
void OnPaint (HWND hwnd)
 
void OnRButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnKey (HWND hwnd, UINT vk, BOOL fDown, int cRepeat, UINT flags)
 
void OnAppBarCallback (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
BOOL AppBar_Register (HWND hwnd)
 
BOOL AppBar_UnRegister (HWND hwnd)
 
BOOL AppBar_SetAutoHide (HWND hwnd, BOOL fHide)
 
BOOL AppBar_AutoHide (HWND hwnd)
 
BOOL AppBar_NoAutoHide (HWND hwnd)
 
BOOL AppBar_SetSide (HWND hwnd, UINT uSide)
 
void AppBar_SetAlwaysOnTop (HWND hwnd, BOOL fOnTop)
 
void AppBar_Hide (HWND hwnd)
 
void AppBar_UnHide (HWND hwnd)
 
void AppBar_SetAutoHideTimer (HWND hwnd)
 
void AppBar_SetAutoUnhideTimer (HWND hwnd)
 
void AppBar_Size (HWND hwnd)
 
void AppBar_QueryPos (HWND hwnd, LPRECT lprc)
 
void AppBar_QuerySetPos (UINT uEdge, LPRECT lprc, PAPPBARDATA pabd, BOOL fMove)
 
void AppBar_PosChanged (PAPPBARDATA pabd)
 
BOOL OnCreate (HWND hwnd, LPCREATESTRUCT lpCreateStruct)
 
void OnActivate (HWND hwnd, UINT state, HWND hwndActDeact, BOOL fMinimized)
 
void OnWindowPosChanged (HWND hwnd, const LPWINDOWPOS lpwpos)
 
void OnSize (HWND hwnd, UINT state, int cx, int cy)
 
void OnMove (HWND hwnd, int x, int y)
 
void OnNCDestroy (HWND hwnd)
 
void OnTimer (HWND hwnd, UINT id)
 
UINT OnNCHitTest (HWND hwnd, int x, int y)
 
void OnLButtonDown (HWND hwnd, BOOL fDoubleClick, int x, int y, UINT keyFlags)
 
void OnMouseMove (HWND hwnd, int x, int y, UINT keyFlags)
 
void OnLButtonUp (HWND hwnd, int x, int y, UINT keyFlags)
 
void GetWorkArea (LPRECT prc) const
 

Protected Attributes

ShellDirectory_dir
 
int _next_id
 
QuickLaunchMap _entries
 
int _btn_dist
 
int _size
 
- Protected Attributes inherited from ExtContextMenuHandlerT< SubclassedWindow >
CtxMenuInterfaces _cm_ifs
 
- Protected Attributes inherited from SubclassedWindow
WNDPROC _orgWndProc
 
- Protected Attributes inherited from Window
HWND m_hwnd
 
BOOL m_fAutoHide
 
BOOL m_fOnTop
 
BOOL m_fHiding
 
UINT m_uSide
 
LONG m_cxWidth
 
LONG m_cyHeight
 
LONG m_cxSave
 
LONG m_cySave
 
BOOL m_fAppBarRegd
 
BOOL m_fMoving
 
BOOL m_bDragged
 
POINT m_ptDragOn
 
RECT m_rcAppBar
 
RECT m_rcDrag
 

Additional Inherited Members

- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 
- Static Protected Member Functions inherited from SubclassedWindow
static LRESULT CALLBACK SubclassedWndProc (HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Static Protected Member Functions inherited from Window
static Windowcreate_controller (HWND hwnd)
 create controller for a new window
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Static Protected Attributes inherited from Window
static WindowMap s_wnd_map
 
static const voids_new_info = NULL
 
static CREATORFUNC s_window_creator = NULL
 
static HHOOK s_hcbtHook = 0
 
static WindowSet s_pretranslate_windows
 
static WindowSet s_dialogs
 

Detailed Description

quick launch bar window

Definition at line 60 of file quicklaunch.h.

Member Typedef Documentation

◆ super

Constructor & Destructor Documentation

◆ QuickLaunchBar()

QuickLaunchBar::QuickLaunchBar ( HWND  hwnd)

Definition at line 49 of file quicklaunch.cpp.

50 : super(hwnd)
51{
52 CONTEXT("QuickLaunchBar::QuickLaunchBar()");
53
54 _dir = NULL;
56 _btn_dist = 20;
57 _size = 0;
58
59 HWND hwndToolTip = (HWND) SendMessage(hwnd, TB_GETTOOLTIPS, 0, 0);
60
61 SetWindowStyle(hwndToolTip, GetWindowStyle(hwndToolTip)|TTS_ALWAYSTIP);
62
63 // delay refresh to some time later
65}
#define NULL
Definition: types.h:112
HANDLE HWND
Definition: compat.h:19
#define PM_REFRESH
Definition: explorer.h:69
#define SetWindowStyle(hwnd, val)
Definition: utility.h:153
struct _CONTEXT CONTEXT
#define TB_GETTOOLTIPS
Definition: commctrl.h:1138
#define TTS_ALWAYSTIP
Definition: commctrl.h:1757
#define IDC_FIRST_QUICK_ID
Definition: quicklaunch.h:36
ShellDirectory * _dir
Definition: quicklaunch.h:74
ExtContextMenuHandlerT< SubclassedWindow > super
Definition: quicklaunch.h:62
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define GetWindowStyle(hwnd)
Definition: windowsx.h:315
#define SendMessage
Definition: winuser.h:5852
#define PostMessage
Definition: winuser.h:5841

◆ ~QuickLaunchBar()

QuickLaunchBar::~QuickLaunchBar ( )

Definition at line 67 of file quicklaunch.cpp.

68{
69 delete _dir;
70}

Member Function Documentation

◆ AddButton()

void QuickLaunchBar::AddButton ( int  id,
HBITMAP  hbmp,
LPCTSTR  name,
Entry entry,
int  flags = TBSTATE_ENABLED 
)
protected

Definition at line 174 of file quicklaunch.cpp.

175{
176 TBADDBITMAP ab = {0, (UINT_PTR)hbmp};
177 int bmp_idx = SendMessage(_hwnd, TB_ADDBITMAP, 1, (LPARAM)&ab);
178
180
181 qle._hbmp = hbmp;
182 qle._title = name;
183 qle._entry = entry;
184
185 _entries[id] = qle;
186
187 TBBUTTON btn = {0, 0, (BYTE)flags, BTNS_BUTTON|BTNS_NOPREFIX, {0, 0}, 0, 0};
188
189 btn.idCommand = id;
190 btn.iBitmap = bmp_idx;
191
193}
HBITMAP hbmp
GLbitfield flags
Definition: glext.h:7161
GLuint id
Definition: glext.h:5910
#define INT_MAX
Definition: limits.h:40
uint32_t entry
Definition: isohybrid.c:63
UCHAR ab[sizeof("Hello World!") -1]
Definition: fdi.c:106
unsigned __int3264 UINT_PTR
Definition: mstsclib_h.h:274
#define TB_INSERTBUTTON
Definition: commctrl.h:1270
#define BTNS_BUTTON
Definition: commctrl.h:998
#define BTNS_NOPREFIX
Definition: commctrl.h:1005
#define TB_ADDBITMAP
Definition: commctrl.h:1056
QuickLaunchMap _entries
Definition: quicklaunch.h:77
quick launch bar shortcut
Definition: quicklaunch.h:44
int idCommand
Definition: commctrl.h:950
int iBitmap
Definition: commctrl.h:949
Definition: name.c:39
LONG_PTR LPARAM
Definition: windef.h:208
unsigned char BYTE
Definition: xxhash.c:193

Referenced by AddShortcuts().

◆ AddShortcuts()

void QuickLaunchBar::AddShortcuts ( )
protected
Todo:
perhaps also look into CSIDL_COMMON_APPDATA ?

Definition at line 90 of file quicklaunch.cpp.

91{
92 CONTEXT("QuickLaunchBar::AddShortcuts()");
93
94 WaitCursor wait;
95
96 try {
98
99 SpecialFolderFSPath app_data(CSIDL_APPDATA, _hwnd);
100
101 _stprintf(path, TEXT("%s\\")QUICKLAUNCH_FOLDER, (LPCTSTR)app_data);
102
104 _dir = new ShellDirectory(GetDesktopFolder(), path, _hwnd);
105
107
108 // immediatelly extract the shortcut icons
109 for(Entry*entry=_dir->_down; entry; entry=entry->_next)
110 entry->_icon_id = entry->safe_extract_icon(ICF_NORMAL);
111 } catch(COMException&) {
112 return;
113 }
114
115
116 ShellFolder desktop_folder;
117 WindowCanvas canvas(_hwnd);
118
121
124
125 TBBUTTON sep = {0, -1, TBSTATE_ENABLED, BTNS_SEP, {0, 0}, 0, 0};
127
128 int cur_desktop = g_Globals._desktops._current_desktop;
129 ResString desktop_fmt(IDS_DESKTOP_NUM);
130
131 HDC hdc = CreateCompatibleDC(canvas);
132 DWORD size = SendMessage(_hwnd, TB_GETBUTTONSIZE, 0, 0);
133 int cx = LOWORD(size);
134 int cy = HIWORD(size);
135 RECT rect = {0, 0, cx, cy};
136 RECT textRect = {0, 0, cx-7, cy-7};
137
138 for(int i=0; i<DESKTOP_COUNT; ++i) {
140 HBITMAP hbmp_old = SelectBitmap(hdc, hbmp);
141
142 FontSelection font(hdc, GetStockFont(ANSI_VAR_FONT));
143 FmtString num_txt(TEXT("%d"), i+1);
144 TextColor color(hdc, RGB(64,64,64));
145 BkMode mode(hdc, TRANSPARENT);
147 DrawText(hdc, num_txt, num_txt.length(), &textRect, DT_CENTER|DT_VCENTER|DT_SINGLELINE);
148
149 SelectBitmap(hdc, hbmp_old);
150
151 AddButton(ID_SWITCH_DESKTOP_1+i, hbmp, FmtString(desktop_fmt, i+1), NULL, cur_desktop==i?TBSTATE_ENABLED|TBSTATE_PRESSED:TBSTATE_ENABLED);
152 }
153 DeleteDC(hdc);
154
155 for(Entry*entry=_dir->_down; entry; entry=entry->_next) {
156 // hide files like "desktop.ini"
157 if (entry->_data.dwFileAttributes & FILE_ATTRIBUTE_HIDDEN)
158 continue;
159
160 // hide subfolders
161 if (!(entry->_data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)) {
163
164 AddButton(_next_id++, hbmp, entry->_display_name, entry); //entry->_etype==ET_SHELL? desktop_folder.get_name(static_cast<ShellEntry*>(entry)->_pidl): entry->_display_name);
165 }
166 }
167
170
172}
#define IDS_TITLE
Definition: resource.h:30
VOID WaitCursor(BOOL bBegin)
Definition: dialog.c:114
size_type size() const
Definition: _map.h:172
#define MAX_PATH
Definition: compat.h:34
#define RGB(r, g, b)
Definition: precomp.h:71
@ ICF_NORMAL
Definition: entries.h:67
#define PM_RESIZE_CHILDREN
Definition: explorer.h:66
unsigned long DWORD
Definition: ntddk_ex.h:95
GLsizeiptr size
Definition: glext.h:5919
GLuint color
Definition: glext.h:6243
GLenum mode
Definition: glext.h:6217
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define TEXT(s)
Definition: k32.h:26
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
@ ICID_EXPLORER
Definition: globals.h:69
@ ICID_MINIMIZE
Definition: globals.h:86
#define DESKTOP_COUNT
Definition: globals.h:238
#define IDS_DESKTOP_NUM
Definition: resource.h:38
#define ID_MINIMIZE_ALL
Definition: resource.h:212
#define IDS_MINIMIZE_ALL
Definition: resource.h:37
#define ID_EXPLORE
Definition: resource.h:213
#define ID_SWITCH_DESKTOP_1
Definition: resource.h:225
BOOL RecursiveCreateDirectory(LPCTSTR path_in)
Definition: utility.cpp:394
#define _stprintf
Definition: utility.h:124
HDC hdc
Definition: main.c:9
static HBITMAP
Definition: button.c:44
static HDC
Definition: imagelist.c:92
Definition: mk_font.cpp:20
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_DIRECTORY
Definition: nt_native.h:705
#define LOWORD(l)
Definition: pedump.c:82
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
#define TBSTATE_PRESSED
Definition: commctrl.h:973
#define BTNS_SEP
Definition: commctrl.h:999
#define TB_GETBUTTONSIZE
Definition: commctrl.h:1160
_Out_opt_ int * cx
Definition: commctrl.h:585
#define TBSTATE_ENABLED
Definition: commctrl.h:974
#define QUICKLAUNCH_FOLDER
Definition: quicklaunch.h:39
ShellFolder & GetDesktopFolder()
#define CSIDL_APPDATA
Definition: shlobj.h:2191
RECT textRect
Definition: startmenu.cpp:1392
& rect
Definition: startmenu.cpp:1413
COLORREF bk_color
Definition: startmenu.cpp:1409
HBRUSH bk_brush
Definition: startmenu.cpp:1410
Exception with context information.
Definition: shellclasses.h:114
int _current_desktop
Definition: globals.h:253
base of all file and directory entries
Definition: entries.h:83
Entry * _down
Definition: entries.h:93
void smart_scan(SORT_ORDER sortOrder=SORT_NAME, int scan_flags=0)
Definition: entries.cpp:353
IconCache _icon_cache
Definition: globals.h:285
Desktops _desktops
Definition: globals.h:291
const Icon & get_icon(int icon_id)
Definition: explorer.cpp:625
HBITMAP create_bitmap(COLORREF bk_color, HBRUSH hbrBkgnd, HDC hdc_wnd) const
Definition: explorer.cpp:285
void AddButton(int id, HBITMAP hbmp, LPCTSTR name, Entry *entry, int flags=TBSTATE_ENABLED)
convenient loading of string resources
Definition: globals.h:304
shell folder entry
Definition: shellfs.h:54
IShellFolder smart pointer.
Definition: shellclasses.h:594
file system path of special folder
#define HIWORD(l)
Definition: typedefs.h:247
DWORD COLORREF
Definition: windef.h:300
#define SelectBitmap(hdc, hbm)
Definition: windowsx.h:514
#define GetStockFont(i)
Definition: windowsx.h:308
#define ANSI_VAR_FONT
Definition: wingdi.h:907
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
#define TRANSPARENT
Definition: wingdi.h:950
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI DeleteDC(_In_ HDC)
DWORD WINAPI GetSysColor(_In_ int)
#define DT_CENTER
Definition: winuser.h:527
HBRUSH WINAPI GetSysColorBrush(_In_ int)
#define DT_SINGLELINE
Definition: winuser.h:540
#define DrawText
Definition: winuser.h:5780
#define DT_VCENTER
Definition: winuser.h:543
HWND WINAPI GetParent(_In_ HWND)
#define COLOR_BTNFACE
Definition: winuser.h:928
char TCHAR
Definition: xmlstorage.h:189
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
#define SORT_NAME
Definition: xpath.c:439

Referenced by WndProc().

◆ Command()

int QuickLaunchBar::Command ( int  id,
int  code 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 266 of file quicklaunch.cpp.

267{
268 CONTEXT("QuickLaunchBar::Command()");
269
270 if ((id&~0xFF) == IDC_FIRST_QUICK_ID) {
272
273 if (qle._entry) {
274 qle._entry->launch_entry(_hwnd);
275 return 0;
276 }
277 }
278
279 return 0; // Don't return 1 to avoid recursion with DesktopBar::Command()
280}
virtual BOOL launch_entry(HWND hwnd, UINT nCmdShow=SW_SHOWNORMAL)
Definition: entries.cpp:443

◆ Create()

HWND QuickLaunchBar::Create ( HWND  hwndParent)
static

Definition at line 72 of file quicklaunch.cpp.

73{
74 CONTEXT("QuickLaunchBar::Create()");
75
76 ClientRect clnt(hwndParent);
77
82 IDW_QUICKLAUNCHBAR, 0, 0, 0, NULL, 0, 0, 0, 16, 16, sizeof(TBBUTTON));
83
84 if (hwnd)
86
87 return hwnd;
88}
HWND WINAPI CreateToolbarEx(HWND hwnd, DWORD style, UINT wID, INT nBitmaps, HINSTANCE hBMInst, UINT_PTR wBMID, LPCTBBUTTON lpButtons, INT iNumButtons, INT dxButton, INT dyButton, INT dxBitmap, INT dyBitmap, UINT uStructSize)
Definition: commctrl.c:929
static HWND hwndParent
Definition: cryptui.c:300
#define WS_CHILD
Definition: pedump.c:617
#define WS_VISIBLE
Definition: pedump.c:620
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define TBSTYLE_TOOLTIPS
Definition: commctrl.h:989
#define CCS_NODIVIDER
Definition: commctrl.h:2248
#define CCS_TOP
Definition: commctrl.h:2242
#define TBSTYLE_FLAT
Definition: commctrl.h:992
#define CCS_NOPARENTALIGN
Definition: commctrl.h:2246
#define CCS_NORESIZE
Definition: commctrl.h:2245
#define TBSTYLE_WRAPABLE
Definition: commctrl.h:990
#define IDW_QUICKLAUNCHBAR
Definition: quicklaunch.h:32
quick launch bar window
Definition: quicklaunch.h:61

Referenced by DesktopBar::Init().

◆ Notify()

int QuickLaunchBar::Notify ( int  id,
NMHDR pnmh 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 282 of file quicklaunch.cpp.

283{
284 switch(pnmh->code) {
285 case TTN_GETDISPINFO: {
286 NMTTDISPINFO* ttdi = (NMTTDISPINFO*) pnmh;
287
288 int id = ttdi->hdr.idFrom;
289 ttdi->lpszText = _entries[id]._title.str();
290#ifdef TTF_DI_SETITEM
291 ttdi->uFlags |= TTF_DI_SETITEM;
292#endif
293
294 // enable multiline tooltips (break at CR/LF and for very long one-line strings)
296
297 break;}
298
299 return super::Notify(id, pnmh);
300 }
301
302 return 0;
303}
#define NMTTDISPINFO
Definition: commctrl.h:1914
#define TTF_DI_SETITEM
Definition: commctrl.h:1772
#define TTN_GETDISPINFO
Definition: commctrl.h:1878
#define TTM_SETMAXTIPWIDTH
Definition: commctrl.h:1819
virtual int Notify(int id, NMHDR *pnmh)
Definition: window.cpp:290
UINT code
Definition: winuser.h:3159
HWND hwndFrom
Definition: winuser.h:3157

◆ UpdateDesktopButtons()

void QuickLaunchBar::UpdateDesktopButtons ( int  desktop_idx)
protected

Definition at line 195 of file quicklaunch.cpp.

196{
197 for(int i=0; i<DESKTOP_COUNT; ++i) {
199
201 }
202}
#define TBBUTTONINFO
Definition: commctrl.h:1254
#define TB_SETBUTTONINFO
Definition: commctrl.h:1263
#define TBIF_STATE
Definition: commctrl.h:1221

Referenced by WndProc().

◆ WndProc()

LRESULT QuickLaunchBar::WndProc ( UINT  nmsg,
WPARAM  wparam,
LPARAM  lparam 
)
protectedvirtual

Reimplemented from SubclassedWindow.

Definition at line 204 of file quicklaunch.cpp.

205{
206 switch(nmsg) {
207 case PM_REFRESH:
208 AddShortcuts();
209 break;
210
211 case PM_GET_WIDTH: {
212 // take line wrapping into account
213 int btns = SendMessage(_hwnd, TB_BUTTONCOUNT, 0, 0);
214 int rows = SendMessage(_hwnd, TB_GETROWS, 0, 0);
215
216 if (rows<2 || rows==btns)
217 return _size;
218
219 RECT rect;
220 int max_cx = 0;
221
223 SendMessage(_hwnd, TB_GETRECT, it->first, (LPARAM)&rect);
224
225 if (rect.right > max_cx)
226 max_cx = rect.right;
227 }
228
229 return max_cx;}
230
233 break;
234
235 case WM_CONTEXTMENU: {
236 TBBUTTON btn;
238 Point screen_pt(lparam), clnt_pt=screen_pt;
239 ScreenToClient(_hwnd, &clnt_pt);
240
241 Entry* entry = NULL;
242 int idx = SendMessage(_hwnd, TB_HITTEST, 0, (LPARAM)&clnt_pt);
243
244 if (idx>=0 &&
245 SendMessage(_hwnd, TB_GETBUTTON, idx, (LPARAM)&btn)!=-1 &&
246 (it=_entries.find(btn.idCommand))!=_entries.end()) {
247 entry = it->second._entry;
248 }
249
250 if (entry) { // entry is NULL for desktop switch buttons
251 HRESULT hr = entry->do_context_menu(_hwnd, screen_pt, _cm_ifs);
252
253 if (!SUCCEEDED(hr))
254 CHECKERROR(hr);
255 } else
256 goto def;
257 break;}
258
259 default: def:
260 return super::WndProc(nmsg, wparam, lparam);
261 }
262
263 return 0;
264}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
Definition: _map.h:210
iterator end()
Definition: _map.h:165
_Rep_type::iterator iterator
Definition: _map.h:85
iterator begin()
Definition: _map.h:163
_Rep_type::const_iterator const_iterator
Definition: _map.h:86
unsigned int idx
Definition: utils.c:41
#define PM_GET_WIDTH
Definition: explorer.h:67
#define SUCCEEDED(hr)
Definition: intsafe.h:50
#define TB_GETRECT
Definition: commctrl.h:1153
#define TB_GETBUTTON
Definition: commctrl.h:1109
#define TB_HITTEST
Definition: commctrl.h:1268
#define TB_GETROWS
Definition: commctrl.h:1142
#define TB_BUTTONCOUNT
Definition: commctrl.h:1110
#define PM_UPDATE_DESKTOP
Definition: quicklaunch.h:34
#define WM_CONTEXTMENU
Definition: richedit.h:64
#define CHECKERROR(hr)
Definition: shellclasses.h:162
HRESULT hr
Definition: shlfolder.c:183
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
void AddShortcuts()
Definition: quicklaunch.cpp:90
void UpdateDesktopButtons(int desktop_idx)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

Member Data Documentation

◆ _btn_dist

int QuickLaunchBar::_btn_dist
protected

Definition at line 78 of file quicklaunch.h.

Referenced by AddShortcuts(), and QuickLaunchBar().

◆ _dir

ShellDirectory* QuickLaunchBar::_dir
protected

Definition at line 74 of file quicklaunch.h.

Referenced by AddShortcuts(), QuickLaunchBar(), and ~QuickLaunchBar().

◆ _entries

QuickLaunchMap QuickLaunchBar::_entries
protected

Definition at line 77 of file quicklaunch.h.

Referenced by AddButton(), AddShortcuts(), Command(), Notify(), and WndProc().

◆ _next_id

int QuickLaunchBar::_next_id
protected

Definition at line 76 of file quicklaunch.h.

Referenced by AddShortcuts(), and QuickLaunchBar().

◆ _size

int QuickLaunchBar::_size
protected

Definition at line 79 of file quicklaunch.h.

Referenced by AddShortcuts(), QuickLaunchBar(), and WndProc().


The documentation for this struct was generated from the following files: