ReactOS  0.4.14-dev-833-g5f692ed
CStartButton Class Reference
Inheritance diagram for CStartButton:
Collaboration diagram for CStartButton:

Public Member Functions

 CStartButton ()
 
virtual ~CStartButton ()
 
SIZE GetSize ()
 
VOID UpdateSize ()
 
VOID UpdateFont ()
 
VOID Initialize ()
 
HWND Create (HWND hwndParent)
 
LRESULT OnLButtonDown (UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled)
 
- Public Member Functions inherited from ATL::CWindowImpl< CStartButton >
HWND Create (HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
- Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
 CWindowImplBaseT ()
 
virtual void OnFinalMessage (HWND)
 
BOOL SubclassWindow (HWND hWnd)
 
virtual WNDPROC GetWindowProc ()
 
LRESULT DefWindowProc (UINT uMsg, WPARAM wParam, LPARAM lParam)
 
HWND Create (HWND hWndParent, _U_RECT rect, LPCTSTR szWindowName, DWORD dwStyle, DWORD dwExStyle, _U_MENUorID MenuOrID, ATOM atom, LPVOID lpCreateParam)
 
- Public Member Functions inherited from ATL::CWindowImplRoot< CWindow >
 CWindowImplRoot ()
 
virtual ~CWindowImplRoot ()
 
- Public Member Functions inherited from ATL::CWindow
 CWindow (HWND hWnd=NULL)
 
 operator HWND () const
 
UINT ArrangeIconicWindows ()
 
void Attach (HWND hWndNew)
 
HDC BeginPaint (LPPAINTSTRUCT lpPaint)
 
BOOL BringWindowToTop ()
 
BOOL CenterWindow (HWND hWndCenter=NULL)
 
BOOL ChangeClipboardChain (HWND hWndNewNext)
 
BOOL CheckDlgButton (int nIDButton, UINT nCheck)
 
BOOL CheckRadioButton (int nIDFirstButton, int nIDLastButton, int nIDCheckButton)
 
HWND ChildWindowFromPoint (POINT point) const
 
HWND ChildWindowFromPointEx (POINT point, UINT uFlags) const
 
BOOL ClientToScreen (LPPOINT lpPoint) const
 
BOOL ClientToScreen (LPRECT lpRect) const
 
HWND Create (LPCTSTR lpstrWndClass, HWND hWndParent, _U_RECT rect=NULL, LPCTSTR szWindowName=NULL, DWORD dwStyle=0, DWORD dwExStyle=0, _U_MENUorID MenuOrID=0U, LPVOID lpCreateParam=NULL)
 
BOOL CreateCaret (HBITMAP pBitmap)
 
BOOL CreateGrayCaret (int nWidth, int nHeight)
 
BOOL CreateSolidCaret (int nWidth, int nHeight)
 
HDWP DeferWindowPos (HDWP hWinPosInfo, HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT uFlags)
 
BOOL DestroyWindow ()
 
HWND Detach ()
 
int DlgDirList (LPTSTR lpPathSpec, int nIDListBox, int nIDStaticPath, UINT nFileType)
 
int DlgDirListComboBox (LPTSTR lpPathSpec, int nIDComboBox, int nIDStaticPath, UINT nFileType)
 
BOOL DlgDirSelect (LPTSTR lpString, int nCount, int nIDListBox)
 
BOOL DlgDirSelectComboBox (LPTSTR lpString, int nCount, int nIDComboBox)
 
void DragAcceptFiles (BOOL bAccept=TRUE)
 
BOOL DrawMenuBar ()
 
BOOL EnableScrollBar (UINT uSBFlags, UINT uArrowFlags=ESB_ENABLE_BOTH)
 
BOOL EnableWindow (BOOL bEnable=TRUE)
 
void EndPaint (LPPAINTSTRUCT lpPaint)
 
BOOL FlashWindow (BOOL bInvert)
 
BOOL GetClientRect (LPRECT lpRect) const
 
HDC GetDC ()
 
HDC GetDCEx (HRGN hRgnClip, DWORD flags)
 
HWND GetDescendantWindow (int nID) const
 
HRESULT GetDlgControl (int nID, REFIID iid, void **ppCtrl)
 
int GetDlgCtrlID () const
 
HRESULT GetDlgHost (int nID, REFIID iid, void **ppHost)
 
HWND GetDlgItem (int nID)
 
UINT GetDlgItemInt (int nID, BOOL *lpTrans=NULL, BOOL bSigned=TRUE) const
 
UINT GetDlgItemText (int nID, LPTSTR lpStr, int nMaxCount) const
 
BOOL GetDlgItemText (int nID, BSTR &bstrText) const
 
DWORD GetExStyle () const
 
HFONT GetFont () const
 
DWORD GetHotKey () const
 
HICON GetIcon (BOOL bBigIcon=TRUE) const
 
HWND GetLastActivePopup () const
 
HMENU GetMenu () const
 
HWND GetNextDlgGroupItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
HWND GetNextDlgTabItem (HWND hWndCtl, BOOL bPrevious=FALSE) const
 
CWindow GetParent () const
 
BOOL GetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo)
 
BOOL GetScrollPos (int nBar)
 
BOOL GetScrollRange (int nBar, LPINT lpMinPos, LPINT lpMaxPos) const
 
DWORD GetStyle () const
 
HMENU GetSystemMenu (BOOL bRevert)
 
HWND GetTopLevelParent () const
 
HWND GetTopLevelWindow () const
 
HWND GetTopWindow () const
 
BOOL GetUpdateRect (LPRECT lpRect, BOOL bErase=FALSE)
 
int GetUpdateRgn (HRGN hRgn, BOOL bErase=FALSE)
 
HWND GetWindow (UINT nCmd) const
 
DWORD GetWindowContextHelpId () const
 
HDC GetWindowDC ()
 
LONG GetWindowLong (int nIndex) const
 
LONG_PTR GetWindowLongPtr (int nIndex) const
 
BOOL GetWindowPlacement (WINDOWPLACEMENT *lpwndpl) const
 
DWORD GetWindowProcessID ()
 
BOOL GetWindowRect (LPRECT lpRect) const
 
int GetWindowRgn (HRGN hRgn)
 
int GetWindowText (LPTSTR lpszStringBuf, int nMaxCount) const
 
BOOL GetWindowText (BSTR &bstrText)
 
int GetWindowTextLength () const
 
DWORD GetWindowThreadID ()
 
WORD GetWindowWord (int nIndex) const
 
void GotoDlgCtrl (HWND hWndCtrl) const
 
BOOL HideCaret ()
 
BOOL HiliteMenuItem (HMENU hMenu, UINT uHiliteItem, UINT uHilite)
 
BOOL Invalidate (BOOL bErase=TRUE)
 
BOOL InvalidateRect (LPCRECT lpRect, BOOL bErase=TRUE)
 
void InvalidateRgn (HRGN hRgn, BOOL bErase=TRUE)
 
BOOL IsChild (const HWND hWnd) const
 
BOOL IsDialogMessage (LPMSG lpMsg)
 
UINT IsDlgButtonChecked (int nIDButton) const
 
BOOL IsIconic () const
 
BOOL IsParentDialog ()
 
BOOL IsWindow () const
 
BOOL IsWindowEnabled () const
 
BOOL IsWindowVisible () const
 
BOOL IsWindowUnicode ()
 
BOOL IsZoomed () const
 
BOOL KillTimer (UINT_PTR nIDEvent)
 
BOOL LockWindowUpdate (BOOL bLock=TRUE)
 
int MapWindowPoints (HWND hWndTo, LPPOINT lpPoint, UINT nCount) const
 
int MapWindowPoints (HWND hWndTo, LPRECT lpRect) const
 
int MessageBox (LPCTSTR lpszText, LPCTSTR lpszCaption=NULL, UINT nType=MB_OK)
 
BOOL ModifyStyle (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL ModifyStyleEx (DWORD dwRemove, DWORD dwAdd, UINT nFlags=0)
 
BOOL MoveWindow (int x, int y, int nWidth, int nHeight, BOOL bRepaint=TRUE)
 
void NextDlgCtrl () const
 
BOOL OpenClipboard ()
 
BOOL PostMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void PrevDlgCtrl () const
 
void Print (HDC hDC, DWORD dwFlags) const
 
void PrintClient (HDC hDC, DWORD dwFlags) const
 
BOOL RedrawWindow (LPCRECT lpRectUpdate=NULL, HRGN hRgnUpdate=NULL, UINT flags=RDW_INVALIDATE|RDW_UPDATENOW|RDW_ERASE)
 
int ReleaseDC (HDC hDC)
 
BOOL ResizeClient (int nWidth, int nHeight, BOOL bRedraw=FALSE)
 
BOOL ScreenToClient (LPPOINT lpPoint) const
 
BOOL ScrollWindow (int xAmount, int yAmount, LPCRECT lpRect=NULL, LPCRECT lpClipRect=NULL)
 
int ScrollWindowEx (int dx, int dy, LPCRECT lpRectScroll, LPCRECT lpRectClip, HRGN hRgnUpdate, LPRECT lpRectUpdate, UINT flags)
 
LRESULT SendDlgItemMessage (int nID, UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
LRESULT SendMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
void SendMessageToDescendants (UINT message, WPARAM wParam=0, LPARAM lParam=0, BOOL bDeep=TRUE)
 
BOOL SendNotifyMessage (UINT message, WPARAM wParam=0, LPARAM lParam=0)
 
HWND SetActiveWindow ()
 
HWND SetCapture ()
 
HWND SetClipboardViewer ()
 
int SetDlgCtrlID (int nID)
 
BOOL SetDlgItemInt (int nID, UINT nValue, BOOL bSigned=TRUE)
 
BOOL SetDlgItemText (int nID, LPCTSTR lpszString)
 
HWND SetFocus ()
 
void SetFont (HFONT hFont, BOOL bRedraw=TRUE)
 
int SetHotKey (WORD wVirtualKeyCode, WORD wModifiers)
 
HICON SetIcon (HICON hIcon, BOOL bBigIcon=TRUE)
 
BOOL SetMenu (HMENU hMenu)
 
HWND SetParent (HWND hWndNewParent)
 
void SetRedraw (BOOL bRedraw=TRUE)
 
int SetScrollInfo (int nBar, LPSCROLLINFO lpScrollInfo, BOOL bRedraw=TRUE)
 
int SetScrollPos (int nBar, int nPos, BOOL bRedraw=TRUE)
 
BOOL SetScrollRange (int nBar, int nMinPos, int nMaxPos, BOOL bRedraw=TRUE)
 
UINT_PTR SetTimer (UINT_PTR nIDEvent, UINT nElapse, void(CALLBACK *lpfnTimer)(HWND, UINT, UINT_PTR, DWORD)=NULL)
 
BOOL SetWindowContextHelpId (DWORD dwContextHelpId)
 
LONG SetWindowLong (int nIndex, LONG dwNewLong)
 
LONG_PTR SetWindowLongPtr (int nIndex, LONG_PTR dwNewLong)
 
BOOL SetWindowPlacement (const WINDOWPLACEMENT *lpwndpl)
 
BOOL SetWindowPos (HWND hWndInsertAfter, int x, int y, int cx, int cy, UINT nFlags)
 
int SetWindowRgn (HRGN hRgn, BOOL bRedraw=FALSE)
 
BOOL SetWindowText (LPCTSTR lpszString)
 
WORD SetWindowWord (int nIndex, WORD wNewWord)
 
BOOL ShowCaret ()
 
BOOL ShowOwnedPopups (BOOL bShow=TRUE)
 
BOOL ShowScrollBar (UINT nBar, BOOL bShow=TRUE)
 
BOOL ShowWindow (int nCmdShow)
 
BOOL ShowWindowAsync (int nCmdShow)
 
BOOL UpdateWindow ()
 
BOOL ValidateRect (LPCRECT lpRect)
 
BOOL ValidateRgn (HRGN hRgn)
 
BOOL WinHelp (LPCTSTR lpszHelp, UINT nCmd=HELP_CONTEXT, DWORD dwData=0)
 
- Public Member Functions inherited from ATL::CMessageMap
virtual BOOL ProcessWindowMessage (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT &lResult, DWORD dwMsgMapID)=0
 

Private Attributes

HIMAGELIST m_ImageList
 
SIZE m_Size
 
HFONT m_Font
 

Additional Inherited Members

- Public Types inherited from ATL::CWindowImplRoot< CWindow >
enum  
 
- Static Public Member Functions inherited from ATL::CWindowImpl< CStartButton >
static LPCTSTR GetWndCaption ()
 
- Static Public Member Functions inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
static DWORD GetWndStyle (DWORD dwStyle)
 
static DWORD GetWndExStyle (DWORD dwExStyle)
 
static LRESULT CALLBACK StartWindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
static LRESULT CALLBACK WindowProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 
- Static Public Member Functions inherited from ATL::CWindow
static LPCTSTR GetWndClassName ()
 
static LRESULT SendMessage (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 
- Public Attributes inherited from ATL::CWindowImplBaseT< CWindow, CControlWinTraits >
WNDPROC m_pfnSuperWindowProc
 
- Public Attributes inherited from ATL::CWindowImplRoot< CWindow >
CWndProcThunk m_thunk
 
const _ATL_MSGm_pCurrentMsg
 
DWORD m_dwState
 
- Public Attributes inherited from ATL::CWindow
HWND m_hWnd
 
- Static Public Attributes inherited from ATL::CWindow
static RECT rcDefault
 

Detailed Description

Definition at line 137 of file traywnd.cpp.

Constructor & Destructor Documentation

◆ CStartButton()

CStartButton::CStartButton ( )
inline

Definition at line 145 of file traywnd.cpp.

146  : m_ImageList(NULL),
147  m_Font(NULL)
148  {
149  m_Size.cx = 0;
150  m_Size.cy = 0;
151  }
HIMAGELIST m_ImageList
Definition: traywnd.cpp:140
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:334
HFONT m_Font
Definition: traywnd.cpp:142
LONG cy
Definition: windef.h:335

◆ ~CStartButton()

virtual CStartButton::~CStartButton ( )
inlinevirtual

Definition at line 153 of file traywnd.cpp.

154  {
155  if (m_ImageList != NULL)
157 
158  if (m_Font != NULL)
160  }
HIMAGELIST m_ImageList
Definition: traywnd.cpp:140
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI ImageList_Destroy(HIMAGELIST himl)
Definition: imagelist.c:928
smooth NULL
Definition: ftsmooth.c:416
HFONT m_Font
Definition: traywnd.cpp:142

Member Function Documentation

◆ Create()

HWND CStartButton::Create ( HWND  hwndParent)
inline

Definition at line 215 of file traywnd.cpp.

216  {
217  WCHAR szStartCaption[32];
219  IDS_START,
220  szStartCaption,
221  _countof(szStartCaption)))
222  {
223  wcscpy(szStartCaption, L"Start");
224  }
225 
227 
229  0,
230  WC_BUTTON,
231  szStartCaption,
232  dwStyle,
233  0, 0, 0, 0,
234  hwndParent,
237  NULL);
238 
239  if (m_hWnd)
240  Initialize();
241 
242  return m_hWnd;
243  }
#define WS_CLIPSIBLINGS
Definition: pedump.c:618
#define BS_LEFT
Definition: winuser.h:265
#define WC_BUTTON
Definition: commctrl.h:4621
#define _countof(array)
Definition: fontsub.cpp:30
#define WS_CHILD
Definition: pedump.c:617
#define IDS_START
Definition: resource.h:98
#define IDC_STARTBTN
Definition: resource.h:133
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CreateWindowEx
Definition: winuser.h:5730
smooth NULL
Definition: ftsmooth.c:416
static HWND hwndParent
Definition: cryptui.c:300
__wchar_t WCHAR
Definition: xmlstorage.h:180
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
unsigned long DWORD
Definition: ntddk_ex.h:95
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
static const WCHAR L[]
Definition: oid.c:1250
HWND m_hWnd
Definition: atlwin.h:268
#define BS_VCENTER
Definition: winuser.h:279
#define BS_PUSHBUTTON
Definition: pedump.c:651
#define WS_VISIBLE
Definition: pedump.c:620
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
VOID Initialize()
Definition: traywnd.cpp:199

Referenced by CTrayWindow::OnCreate().

◆ GetSize()

SIZE CStartButton::GetSize ( )
inline

Definition at line 162 of file traywnd.cpp.

163  {
164  return m_Size;
165  }

Referenced by CTrayWindow::AlignControls(), and CTrayWindow::RegLoadSettings().

◆ Initialize()

VOID CStartButton::Initialize ( )
inline

Definition at line 199 of file traywnd.cpp.

200  {
202  SetWindowTheme(m_hWnd, L"Start", NULL);
203 
206  0, 0, 0,
207  IMAGE_BITMAP,
209 
212  UpdateSize();
213  }
HIMAGELIST m_ImageList
Definition: traywnd.cpp:140
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
Definition: uxthemesupp.c:69
smooth NULL
Definition: ftsmooth.c:416
LONG_PTR LPARAM
Definition: windef.h:208
HINSTANCE hExplorerInstance
Definition: explorer.cpp:24
#define BUTTON_IMAGELIST_ALIGN_LEFT
Definition: commctrl.h:4623
static const WCHAR L[]
Definition: oid.c:1250
#define LR_LOADTRANSPARENT
Definition: winuser.h:1083
HWND m_hWnd
Definition: atlwin.h:268
#define IDB_START
Definition: resource.h:77
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define LR_CREATEDIBSECTION
Definition: winuser.h:1088
#define IMAGE_BITMAP
Definition: winuser.h:211
HIMAGELIST WINAPI ImageList_LoadImageW(HINSTANCE hi, LPCWSTR lpbmp, INT cx, INT cGrow, COLORREF clrMask, UINT uType, UINT uFlags)
Definition: imagelist.c:2208
VOID UpdateSize()
Definition: traywnd.cpp:167
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define BCM_SETIMAGELIST
Definition: commctrl.h:4638

Referenced by Create().

◆ OnLButtonDown()

LRESULT CStartButton::OnLButtonDown ( UINT  uMsg,
WPARAM  wParam,
LPARAM  lParam,
BOOL bHandled 
)
inline

Definition at line 245 of file traywnd.cpp.

246  {
247  if (uMsg == WM_KEYUP && wParam != VK_SPACE)
248  return 0;
249 
251  return 0;
252  }
WPARAM wParam
Definition: combotst.c:138
#define TWM_OPENSTARTMENU
Definition: precomp.h:131
#define WM_KEYUP
Definition: winuser.h:1698
BOOL PostMessage(UINT message, WPARAM wParam=0, LPARAM lParam=0)
Definition: atlwin.h:976
#define VK_SPACE
Definition: winuser.h:2194
CWindow GetParent() const
Definition: atlwin.h:654

◆ UpdateFont()

VOID CStartButton::UpdateFont ( )
inline

Definition at line 183 of file traywnd.cpp.

184  {
185  /* Get the system fonts, we use the caption font, always bold, though. */
186  NONCLIENTMETRICS ncm = {sizeof(ncm)};
187  if (!SystemParametersInfoW(SPI_GETNONCLIENTMETRICS, sizeof(ncm), &ncm, FALSE))
188  return;
189 
190  if (m_Font)
192 
193  ncm.lfCaptionFont.lfWeight = FW_BOLD;
194  m_Font = CreateFontIndirect(&ncm.lfCaptionFont);
195 
196  SetFont(m_Font, FALSE);
197  }
void SetFont(HFONT hFont, BOOL bRedraw=TRUE)
Definition: atlwin.h:1136
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI SystemParametersInfoW(_In_ UINT, _In_ UINT, _Inout_opt_ PVOID, _In_ UINT)
HFONT m_Font
Definition: traywnd.cpp:142
#define FW_BOLD
Definition: wingdi.h:377
#define CreateFontIndirect
Definition: wingdi.h:4443

Referenced by CTrayWindow::UpdateFonts().

◆ UpdateSize()

VOID CStartButton::UpdateSize ( )
inline

Definition at line 167 of file traywnd.cpp.

168  {
169  SIZE Size = { 0, 0 };
170 
171  if (m_ImageList == NULL ||
173  {
175  }
176 
178 
179  /* Save the size of the start button */
180  m_Size = Size;
181  }
#define max(a, b)
Definition: svc.c:63
HIMAGELIST m_ImageList
Definition: traywnd.cpp:140
#define SM_CXEDGE
Definition: winuser.h:998
smooth NULL
Definition: ftsmooth.c:416
LONG cx
Definition: windef.h:334
LONG_PTR LPARAM
Definition: windef.h:208
#define SM_CYCAPTION
Definition: winuser.h:953
int WINAPI GetSystemMetrics(_In_ int)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BCM_GETIDEALSIZE
Definition: commctrl.h:4635

Referenced by CTrayWindow::AlignControls(), and Initialize().

Member Data Documentation

◆ m_Font

HFONT CStartButton::m_Font
private

Definition at line 142 of file traywnd.cpp.

Referenced by UpdateFont(), and ~CStartButton().

◆ m_ImageList

HIMAGELIST CStartButton::m_ImageList
private

Definition at line 140 of file traywnd.cpp.

Referenced by Initialize(), UpdateSize(), and ~CStartButton().

◆ m_Size

SIZE CStartButton::m_Size
private

Definition at line 141 of file traywnd.cpp.

Referenced by CStartButton(), GetSize(), and UpdateSize().


The documentation for this class was generated from the following file: