ReactOS  0.4.15-dev-1206-g731eddf
StartButton Struct Reference

special "Start" button with one click activation More...

#include <desktopbar.h>

Inheritance diagram for StartButton:
Collaboration diagram for StartButton:

Public Types

typedef PictureButton super
 
- Public Types inherited from PictureButton
typedef OwnerdrawnButton super
 
- Public Types inherited from OwnerdrawnButton
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

 StartButton (HWND hwnd)
 
- Public Member Functions inherited from PictureButton
 PictureButton (HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 
 PictureButton (HWND hparent, int id, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 
 PictureButton (HWND hwnd, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 
 PictureButton (HWND hparent, int id, HBITMAP hBmp, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
 
- Public Member Functions inherited from OwnerdrawnButton
 OwnerdrawnButton (HWND hwnd)
 
- 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 ()
 

Protected Member Functions

LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Protected Member Functions inherited from PictureButton
virtual void DrawItem (LPDRAWITEMSTRUCT dis)
 
- Protected Member Functions inherited from OwnerdrawnButton
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Protected Member Functions inherited from SubclassedWindow
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)
 
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
 

Additional Inherited Members

- 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 More...
 
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)
 
- 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 More...
 
static StaticWindowDataGetStaticWindowData ()
 
static LRESULT CALLBACK MDICBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
static LRESULT CALLBACK PropSheetCBTHookProc (int code, WPARAM wparam, LPARAM lparam)
 
- Protected Attributes inherited from PictureButton
HICON _hIcon
 
HBITMAP _hBmp
 
HBRUSH _hBrush
 
int _cx
 
int _cy
 
bool _flat
 
- 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
 
- 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

special "Start" button with one click activation

Definition at line 132 of file desktopbar.h.

Member Typedef Documentation

◆ super

Definition at line 134 of file desktopbar.h.

Constructor & Destructor Documentation

◆ StartButton()

StartButton::StartButton ( HWND  hwnd)

Definition at line 173 of file desktopbar.cpp.

175 {
176 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IDI_STARTMENU
Definition: resource.h:14
PictureButton(HWND hwnd, HICON hIcon, HBRUSH hbrush=GetSysColorBrush(COLOR_BTNFACE), bool flat=false)
Definition: window.h:721
convenient loading of small (16x16) icon resources
Definition: globals.h:320
#define COLOR_BTNFACE
Definition: winuser.h:918
HBRUSH WINAPI GetSysColorBrush(_In_ int)

Member Function Documentation

◆ WndProc()

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

Reimplemented from SubclassedWindow.

Definition at line 178 of file desktopbar.cpp.

179 {
180  switch(nmsg) {
181  // one click activation: handle button-down message, don't wait for button-up
182  case WM_LBUTTONDOWN:
183  if (!Button_GetState(_hwnd)) {
184  Button_SetState(_hwnd, TRUE);
185 
186  SetCapture(_hwnd);
187 
188  SendMessage(GetParent(_hwnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(_hwnd),0), 0);
189  }
190 
191  Button_SetState(_hwnd, FALSE);
192  break;
193 
194  // re-target mouse move messages while moving the mouse cursor through the start menu
195  case WM_MOUSEMOVE:
196  if (GetCapture() == _hwnd) {
198 
199  ClientToScreen(_hwnd, &pt);
201 
202  if (hwnd && hwnd!=_hwnd) {
205  }
206  }
207  break;
208 
209  case WM_LBUTTONUP:
210  if (GetCapture() == _hwnd) {
211  ReleaseCapture();
212 
214 
215  ClientToScreen(_hwnd, &pt);
217 
218  if (hwnd && hwnd!=_hwnd) {
222  }
223  }
224  break;
225 
226  case WM_CANCELMODE:
227  ReleaseCapture();
228  break;
229 
230  default:
231  return super::WndProc(nmsg, wparam, lparam);
232  }
233 
234  return 0;
235 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define MAKEWPARAM(l, h)
Definition: winuser.h:3984
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
#define WM_LBUTTONDOWN
Definition: winuser.h:1758
#define TRUE
Definition: types.h:120
#define pt(x, y)
Definition: drawing.c:79
#define MAKELPARAM(l, h)
Definition: winuser.h:3983
#define GET_X_LPARAM(lp)
Definition: windowsx.h:274
#define Button_GetState(hwndCtl)
Definition: windowsx.h:7
int WINAPI GetDlgCtrlID(_In_ HWND)
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: window.cpp:865
#define FALSE
Definition: types.h:117
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
HWND WINAPI GetCapture(void)
Definition: message.c:2880
#define Button_SetState(hwndCtl, state)
Definition: windowsx.h:11
#define PostMessage
Definition: winuser.h:5807
#define WM_CANCELMODE
Definition: winuser.h:1617
#define WM_COMMAND
Definition: winuser.h:1722
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI SetCapture(_In_ HWND hWnd)
#define WM_LBUTTONUP
Definition: winuser.h:1759
#define WM_MOUSEMOVE
Definition: winuser.h:1757
HWND WINAPI WindowFromPoint(_In_ POINT)
#define GET_Y_LPARAM(lp)
Definition: windowsx.h:275
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889
#define SendMessage
Definition: winuser.h:5818
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
static UINT WPARAM wparam
Definition: combo.c:716

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