ReactOS 0.4.16-dev-321-g63bb46a
StartMenuRoot Struct Reference

Startmenu root window. More...

#include <startmenu.h>

Inheritance diagram for StartMenuRoot:
Collaboration diagram for StartMenuRoot:

Public Types

typedef StartMenuHandler super
 
- Public Types inherited from StartMenuHandler
typedef StartMenu super
 
- Public Types inherited from StartMenu
typedef ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > > super
 
- Public Types inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
typedef OwnerDrawParent< DialogWindowsuper
 
- Public Types inherited from OwnerDrawParent< DialogWindow >
typedef DialogWindow super
 
- Public Types inherited from DialogWindow
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

 StartMenuRoot (HWND hwnd, const StartMenuRootCreateInfo &info)
 
void TrackStartmenu ()
 
void CloseStartMenu (int id=0)
 close all windows of the start menu popup
 
bool IsStartMenuVisible () const
 
int Command (int id, int code)
 
- Public Member Functions inherited from StartMenuHandler
 StartMenuHandler (HWND hwnd, int icon_size=ICON_SIZE_SMALL)
 
 StartMenuHandler (HWND hwnd, const StartMenuCreateInfo &create_info, int icon_size=ICON_SIZE_SMALL)
 
- Public Member Functions inherited from StartMenu
 StartMenu (HWND hwnd, int icon_size=ICON_SIZE_SMALL)
 
 StartMenu (HWND hwnd, const StartMenuCreateInfo &create_info, int icon_size=ICON_SIZE_SMALL)
 
 ~StartMenu ()
 
- Public Member Functions inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
 ExtContextMenuHandlerT (HWND hwnd)
 
 ExtContextMenuHandlerT (HWND hwnd, const PARA &info)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from OwnerDrawParent< DialogWindow >
 OwnerDrawParent (HWND hwnd)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
- Public Member Functions inherited from DialogWindow
 DialogWindow (HWND hwnd)
 
 ~DialogWindow ()
 
- 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 hwndDesktopBar, int icon_size)
 
- Static Public Member Functions inherited from StartMenu
static HWND Create (int x, int y, const StartMenuFolders &, HWND hwndParent, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL, const String &filter="")
 
- 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)
 

Public Attributes

HWND _hwndStartButton
 
- Public Attributes inherited from Window
IAccessible IAccessible_iface
 
IOleWindow IOleWindow_iface
 
IEnumVARIANT IEnumVARIANT_iface
 
LONG ref
 

Protected Member Functions

LRESULT Init (LPCREATESTRUCT pcs)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
virtual void AddEntries ()
 
virtual void ProcessKey (int vk)
 
void Paint (PaintCanvas &canvas)
 
void ReadLogoSize ()
 
UINT GetLogoResId ()
 
int Command (int id, int code)
 
- Protected Member Functions inherited from StartMenu
LRESULT Init (LPCREATESTRUCT pcs)
 
LRESULT WndProc (UINT nmsg, WPARAM wparam, LPARAM lparam)
 
int Command (int id, int code)
 
void ResizeButtons (int cx)
 
virtual void AddEntries ()
 
ShellEntryMap::iterator AddEntry (const String &title, ICON_ID icon_id, Entry *entry)
 
ShellEntryMap::iterator AddEntry (const String &title, ICON_ID icon_id=ICID_NONE, int id=-1)
 
ShellEntryMap::iterator AddEntry (const ShellFolder folder, ShellEntry *entry)
 
ShellEntryMap::iterator AddEntry (const ShellFolder folder, Entry *entry)
 
void AddShellEntries (const ShellDirectory &dir, int max=-1, const String &ignore="")
 
void AddButton (LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
 
void AddSeparator ()
 
bool CloseSubmenus ()
 
bool CloseOtherSubmenus (int id=0)
 
void CreateSubmenu (int id, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
bool CreateSubmenu (int id, int folder, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
bool CreateSubmenu (int id, int folder1, int folder2, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
void CreateSubmenu (int id, const StartMenuFolders &new_folders, LPCTSTR title, CREATORFUNC_INFO creator=s_def_creator, void *info=NULL)
 
void ActivateEntry (int id, const ShellEntrySet &entries)
 
virtual void CloseStartMenu (int id=0)
 close all windows of the start menu popup
 
bool GetButtonRect (int id, PRECT prect) const
 
void DrawFloatingButton (HDC hdc)
 
void GetFloatingButtonRect (LPRECT prect)
 
void GetArrowButtonRects (LPRECT prect_up, LPRECT prect_down, int icon_size)
 
void DrawArrows (HDC hdc, int icon_size)
 
void Paint (PaintCanvas &canvas)
 
void UpdateIcons ()
 
- 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

SIZE _logo_size
 
- Protected Attributes inherited from StartMenu
int _next_id
 
ShellEntryMap _entries
 
StartMenuShellDirs _dirs
 
int _submenu_id
 
WindowHandle _submenu
 
int _border_left
 
int _border_top
 
int _bottom_max
 
bool _floating_btn
 
bool _arrow_btns
 
POINT _last_pos
 
enum StartMenu::SCROLL_MODE _scroll_mode
 
int _scroll_pos
 
int _invisible_lines
 
StartMenuCreateInfo _create_info
 
int _icon_size
 
- Protected Attributes inherited from ExtContextMenuHandlerT< OwnerDrawParent< DialogWindow > >
CtxMenuInterfaces _cm_ifs
 
- 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

- Static Public Attributes inherited from StartMenu
static CREATORFUNC_INFO s_def_creator = STARTMENU_CREATOR(StartMenu)
 
- Protected Types inherited from StartMenu
enum  SCROLL_MODE { SCROLL_NOT , SCROLL_UP , SCROLL_DOWN }
 
- Static Protected Member Functions inherited from StartMenuHandler
static void ShowLaunchDialog (HWND hwndOwner)
 
static void ShowLogoffDialog (HWND hwndOwner)
 
static void ShowRestartDialog (HWND hwndOwner, UINT flags)
 
static void ShowSearchDialog ()
 
static void ShowSearchComputer ()
 
- Static Protected Member Functions inherited from StartMenu
static BtnWindowClassGetWndClasss ()
 
- 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

Startmenu root window.

Definition at line 364 of file startmenu.h.

Member Typedef Documentation

◆ super

Definition at line 366 of file startmenu.h.

Constructor & Destructor Documentation

◆ StartMenuRoot()

StartMenuRoot::StartMenuRoot ( HWND  hwnd,
const StartMenuRootCreateInfo info 
)

Definition at line 1557 of file startmenu.cpp.

1558 : super(hwnd, info._icon_size),
1560{
1561 if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCOMMONGROUPS))
1562 try {
1563 // insert directory "All Users\Start Menu"
1566 } catch(COMException&) {
1567 // ignore exception and don't show additional shortcuts
1568 }
1569
1570 try {
1571 // insert directory "<user name>\Start Menu"
1572 ShellDirectory usr_startmenu(GetDesktopFolder(), SpecialFolderPath(CSIDL_STARTMENU, _hwnd), _hwnd);
1574 } catch(COMException&) {
1575 // ignore exception and don't show additional shortcuts
1576 }
1577
1578 ReadLogoSize();
1579}
void push_back(const_reference __x)
Definition: _list.h:509
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
ShellFolder & GetDesktopFolder()
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2194
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2195
#define CSIDL_STARTMENU
Definition: shlobj.h:2184
#define CSIDL_PROGRAMS
Definition: shlobj.h:2175
@ REST_NOCOMMONGROUPS
Definition: shlobj.h:1665
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
Definition: shpolicy.c:150
Exception with context information.
Definition: shellclasses.h:114
shell folder entry
Definition: shellfs.h:54
file system path of special folder
Retrieval of special shell folder paths.
Definition: shellclasses.h:982
StartMenuDirectory is used to store the base directory of start menus.
Definition: startmenu.h:53
void ReadLogoSize()
Definition: startmenu.cpp:1581
StartMenuHandler super
Definition: startmenu.h:366
HWND _hwndStartButton
Definition: startmenu.h:376
StartMenuShellDirs _dirs
Definition: startmenu.h:232
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
const CHAR * LPCTSTR
Definition: xmlstorage.h:193

Member Function Documentation

◆ AddEntries()

void StartMenuRoot::AddEntries ( )
protectedvirtual

Reimplemented from StartMenu.

Definition at line 1757 of file startmenu.cpp.

1758{
1760
1762}
#define IDC_EXPLORE
Definition: desktopbar.h:50
@ ICID_EXPLORER
Definition: globals.h:69
#define IDS_EXPLORE
Definition: resource.h:16
convenient loading of string resources
Definition: globals.h:304
void AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
Definition: startmenu.cpp:1137
virtual void AddEntries()
Definition: startmenu.cpp:209

◆ CloseStartMenu()

void StartMenuRoot::CloseStartMenu ( int  id = 0)
virtual

close all windows of the start menu popup

Reimplemented from StartMenu.

Definition at line 1821 of file startmenu.cpp.

1822{
1823 if (_submenu)
1824 CloseSubmenus();
1825
1826 ShowWindow(_hwnd, SW_HIDE);
1827}
WindowHandle _submenu
Definition: startmenu.h:235
bool CloseSubmenus()
Definition: startmenu.h:286
#define SW_HIDE
Definition: winuser.h:771
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)

Referenced by TrackStartmenu().

◆ Command()

int StartMenuRoot::Command ( int  id,
int  code 
)
virtual

Reimplemented from StartMenuHandler.

Definition at line 1691 of file startmenu.cpp.

1692{
1693 return super::Command(id, code);
1694}
int Command(int id, int code)
Definition: startmenu.cpp:1849
Definition: inflate.c:139

◆ Create()

HWND StartMenuRoot::Create ( HWND  hwndDesktopBar,
int  icon_size 
)
static

Definition at line 1608 of file startmenu.cpp.

1609{
1610 RECT rect;
1611
1612 CalculateStartPos(hwndOwner, rect, icon_size);
1613
1614 StartMenuRootCreateInfo create_info;
1615
1616 create_info._icon_size = icon_size;
1617
1620 rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, hwndOwner);
1621}
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
Definition: window.h:215
#define WS_POPUP
Definition: pedump.c:616
#define WS_CLIPCHILDREN
Definition: pedump.c:619
#define WS_THICKFRAME
Definition: pedump.c:630
iconPos iconPos icon_size
Definition: startmenu.cpp:1416
& rect
Definition: startmenu.cpp:1413
static void CalculateStartPos(HWND hwndOwner, RECT &rect, int icon_size)
Definition: startmenu.cpp:1594
#define TITLE_STARTMENU
Definition: startmenu.h:30
Startmenu root window.
Definition: startmenu.h:365
static BtnWindowClass & GetWndClasss()
Definition: startmenu.cpp:108
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)
Definition: window.cpp:87

Referenced by DesktopBar::Init().

◆ GetLogoResId()

UINT StartMenuRoot::GetLogoResId ( )
protected

Definition at line 1806 of file startmenu.cpp.

1807{
1808 WindowCanvas dc(_hwnd);
1809
1810 int clr_bits = GetDeviceCaps(dc, BITSPIXEL);
1811
1812 if (clr_bits > 8)
1813 return IDB_LOGOV;
1814 else if (clr_bits > 4)
1815 return IDB_LOGOV256;
1816 else
1817 return IDB_LOGOV16;
1818}
static const WCHAR dc[]
#define IDB_LOGOV
Definition: resource.h:75
#define IDB_LOGOV16
Definition: resource.h:115
#define IDB_LOGOV256
Definition: resource.h:76
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define BITSPIXEL
Definition: wingdi.h:720

Referenced by Paint(), and ReadLogoSize().

◆ Init()

LRESULT StartMenuRoot::Init ( LPCREATESTRUCT  pcs)
protectedvirtual

Reimplemented from StartMenu.

Definition at line 1696 of file startmenu.cpp.

1697{
1698 // add buttons for entries in _entries
1699 if (super::Init(pcs))
1700 return 1;
1701
1702 AddSeparator();
1703
1704
1705 // insert hard coded start entries
1707
1709
1710 if (!g_Globals._SHRestricted || !SHRestricted(REST_NORECENTDOCSMENU))
1712
1714
1716
1718
1719 if (!g_Globals._SHRestricted || !SHRestricted(REST_NOFIND))
1721
1723
1724 if (!g_Globals._SHRestricted || !SHRestricted(REST_NORUN))
1726
1727
1728 AddSeparator();
1729
1730
1731 if (!g_Globals._SHRestricted || SHRestricted(REST_STARTMENULOGOFF) != 1)
1733
1734#ifdef __REACTOS__
1736#endif
1737
1738 if (!g_Globals._SHRestricted || !SHRestricted(REST_NOCLOSE))
1740
1741#ifndef __REACTOS__
1743#endif
1744
1745
1746
1747
1748#ifdef _LIGHT_STARTMENU
1749 // set the window size to fit all buttons
1750 ResizeToButtons();
1751#endif
1752
1753 return 0;
1754}
#define IDS_PROGRAMS
Definition: resource.h:69
#define IDC_BROWSE
Definition: resource.h:21
#define IDC_SETTINGS
Definition: desktopbar.h:44
#define IDC_RESTART
Definition: desktopbar.h:62
#define IDC_FAVORITES
Definition: desktopbar.h:48
#define IDC_PROGRAMS
Definition: desktopbar.h:49
#define IDC_SHUTDOWN
Definition: desktopbar.h:39
#define IDC_LAUNCH
Definition: desktopbar.h:40
#define IDC_DOCUMENTS
Definition: desktopbar.h:46
#define IDC_TERMINATE
Definition: desktopbar.h:61
#define IDC_SEARCH
Definition: desktopbar.h:60
#define IDC_RECENT
Definition: desktopbar.h:47
#define IDC_LOGOFF
Definition: desktopbar.h:38
#define IDC_START_HELP
Definition: desktopbar.h:41
#define IDS_RESTART
Definition: resource.h:50
#define IDS_FAVORITES
Definition: resource.h:35
#define IDS_SEARCH
Definition: resource.h:34
#define IDS_SETTINGS
Definition: resource.h:16
#define IDS_BROWSE
Definition: resource.h:27
@ ICID_INFO
Definition: globals.h:74
@ ICID_DOCUMENTS
Definition: globals.h:72
@ ICID_RECENT
Definition: globals.h:91
@ ICID_RESTART
Definition: globals.h:84
@ ICID_SHUTDOWN
Definition: globals.h:83
@ ICID_ACTION
Definition: globals.h:77
@ ICID_CONFIG
Definition: globals.h:71
@ ICID_FAVORITES
Definition: globals.h:73
@ ICID_SEARCH
Definition: globals.h:76
@ ICID_LOGOFF
Definition: globals.h:82
@ ICID_FOLDER
Definition: globals.h:66
@ ICID_APPS
Definition: globals.h:75
#define IDS_TERMINATE
Definition: resource.h:49
#define IDS_START_HELP
Definition: resource.h:10
#define IDS_DOCUMENTS
Definition: resource.h:12
#define IDS_SHUTDOWN
Definition: resource.h:8
#define IDS_LAUNCH
Definition: resource.h:9
#define IDS_LOGOFF
Definition: resource.h:7
@ REST_STARTMENULOGOFF
Definition: shlobj.h:1671
@ REST_NORECENTDOCSMENU
Definition: shlobj.h:1675
@ REST_NORUN
Definition: shlobj.h:1643
@ REST_NOFIND
Definition: shlobj.h:1650
@ REST_NOCLOSE
Definition: shlobj.h:1644
#define IDS_RECENT
Definition: shresdef.h:88
void AddSeparator()
Definition: startmenu.cpp:1173
LRESULT Init(LPCREATESTRUCT pcs)
Definition: startmenu.cpp:164

◆ IsStartMenuVisible()

bool StartMenuRoot::IsStartMenuVisible ( ) const

Definition at line 1829 of file startmenu.cpp.

1830{
1831 return IsWindowVisible(_hwnd) != FALSE;
1832}
#define FALSE
Definition: types.h:117
BOOL WINAPI IsWindowVisible(_In_ HWND)

◆ Paint()

void StartMenuRoot::Paint ( PaintCanvas &  canvas)
protected

Definition at line 1785 of file startmenu.cpp.

1786{
1787 MemCanvas mem_dc;
1789 BitmapSelection sel(mem_dc, bmp);
1790
1791 ClientRect clnt(_hwnd);
1792 int h = min(_logo_size.cy, clnt.bottom);
1793
1794 RECT rect = {0, 0, _logo_size.cx, clnt.bottom-h};
1795 HBRUSH hbr = CreateSolidBrush(GetPixel(mem_dc, 0, 0));
1796 FillRect(canvas, &rect, hbr);
1797 DeleteObject(hbr);
1798
1799 PatBlt(canvas, _logo_size.cx, 0, 1, clnt.bottom, WHITENESS);
1800
1801 BitBlt(canvas, 0, clnt.bottom-h, _logo_size.cx, h, mem_dc, 0, ( h<_logo_size.cy ? _logo_size.cy-h : 0) , SRCCOPY);
1802
1803 super::Paint(canvas);
1804}
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
Definition: common.c:57
pKey DeleteObject()
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BITMAP bmp
Definition: alphablend.c:62
#define min(a, b)
Definition: monoChain.cc:55
convenient loading of bitmap resources
Definition: globals.h:346
UINT GetLogoResId()
Definition: startmenu.cpp:1806
SIZE _logo_size
Definition: startmenu.h:382
void Paint(PaintCanvas &canvas)
Definition: startmenu.cpp:870
LONG cx
Definition: kdterminal.h:27
LONG cy
Definition: kdterminal.h:28
#define WHITENESS
Definition: wingdi.h:337
#define SRCCOPY
Definition: wingdi.h:333
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)

Referenced by WndProc().

◆ ProcessKey()

void StartMenuRoot::ProcessKey ( int  vk)
protectedvirtual

Definition at line 1834 of file startmenu.cpp.

1835{
1836 switch(vk) {
1837 case VK_LEFT:
1838 if (_submenu)
1840 // don't close start menu root
1841 break;
1842
1843 default:
1844 super::ProcessKey(vk);
1845 }
1846}
WORD vk
Definition: input.c:77
bool CloseOtherSubmenus(int id=0)
Definition: startmenu.cpp:1197
#define VK_LEFT
Definition: winuser.h:2227

◆ ReadLogoSize()

void StartMenuRoot::ReadLogoSize ( )
protected

Definition at line 1581 of file startmenu.cpp.

1582{
1583 // read size of logo bitmap
1584 BITMAP bmp_hdr;
1585 GetObject(ResBitmap(GetLogoResId()), sizeof(BITMAP), &bmp_hdr);
1586 _logo_size.cx = bmp_hdr.bmWidth;
1587 _logo_size.cy = bmp_hdr.bmHeight;
1588
1589 // cache logo width
1591}
int _border_left
Definition: startmenu.h:237
Definition: bl.h:1331
#define GetObject
Definition: wingdi.h:4468

Referenced by StartMenuRoot(), and WndProc().

◆ TrackStartmenu()

void StartMenuRoot::TrackStartmenu ( )

Definition at line 1624 of file startmenu.cpp.

1625{
1626 MSG msg;
1627 HWND hwnd = _hwnd;
1628
1629#ifdef _LIGHT_STARTMENU
1630 _selected_id = -1;
1631#endif
1632
1633#ifdef _LIGHT_STARTMENU
1634 // recalculate start menu root position
1635 RECT rect;
1636
1638
1639 SetWindowPos(hwnd, 0, rect.left, rect.top, rect.right-rect.left, rect.bottom-rect.top, 0);
1640
1641 ResizeToButtons();
1642#endif
1643
1644 // show previously hidden start menu
1647
1648 while(IsWindow(hwnd) && IsWindowVisible(hwnd)) {
1649 if (!GetMessage(&msg, 0, 0, 0)) {
1650 PostQuitMessage(msg.wParam);
1651 break;
1652 }
1653
1654 // Check for a mouse click on any window, that is not part of the start menu
1655 if (msg.message==WM_LBUTTONDOWN || msg.message==WM_MBUTTONDOWN || msg.message==WM_RBUTTONDOWN) {
1656 StartMenu* menu_wnd = NULL;
1657
1658 for(HWND hwnd=msg.hwnd; hwnd; hwnd=GetParent(hwnd)) {
1659 menu_wnd = WINDOW_DYNAMIC_CAST(StartMenu, hwnd);
1660
1661 if (menu_wnd)
1662 break;
1663 }
1664
1665 if (!menu_wnd) {
1667 break;
1668 }
1669 }
1670
1671 try {
1672 if (pretranslate_msg(&msg))
1673 continue;
1674
1676 continue;
1677
1679
1680 try {
1682 } catch(COMException& e) {
1683 HandleException(e, _hwnd);
1684 }
1685 } catch(COMException& e) {
1686 HandleException(e, _hwnd);
1687 }
1688 }
1689}
#define msg(x)
Definition: auth_time.c:54
#define NULL
Definition: types.h:112
#define e
Definition: ke_i.h:82
#define WINDOW_DYNAMIC_CAST(CLASS, hwnd)
Definition: window.h:166
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
void CloseStartMenu(int id=0)
close all windows of the start menu popup
Definition: startmenu.cpp:1821
int _icon_size
Definition: startmenu.h:251
static BOOL pretranslate_msg(LPMSG pmsg)
Definition: window.cpp:589
static BOOL dispatch_dialog_msg(LPMSG pmsg)
Definition: window.cpp:619
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1829
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
__analysis_noreturn void WINAPI PostQuitMessage(_In_ int)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
#define WM_LBUTTONDOWN
Definition: winuser.h:1779
#define WM_RBUTTONDOWN
Definition: winuser.h:1782
#define GetMessage
Definition: winuser.h:5802
HWND WINAPI GetParent(_In_ HWND)
#define SW_SHOW
Definition: winuser.h:778
#define DispatchMessage
Definition: winuser.h:5777
#define WM_MBUTTONDOWN
Definition: winuser.h:1785

◆ WndProc()

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

Reimplemented from StartMenu.

Definition at line 1765 of file startmenu.cpp.

1766{
1767 switch(nmsg) {
1768 case WM_PAINT: {
1769 PaintCanvas canvas(_hwnd);
1770 Paint(canvas);
1771 break;}
1772
1773 case WM_DISPLAYCHANGE:
1774 // re-evaluate logo size using the correct color depth
1775 ReadLogoSize();
1776 break;
1777
1778 default:
1779 return super::WndProc(nmsg, wparam, lparam);
1780 }
1781
1782 return 0;
1783}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
void Paint(PaintCanvas &canvas)
Definition: startmenu.cpp:1785
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: startmenu.cpp:299
#define WM_PAINT
Definition: winuser.h:1623

Member Data Documentation

◆ _hwndStartButton

HWND StartMenuRoot::_hwndStartButton

Definition at line 376 of file startmenu.h.

Referenced by TrackStartmenu().

◆ _logo_size

SIZE StartMenuRoot::_logo_size
protected

Definition at line 382 of file startmenu.h.

Referenced by Paint(), and ReadLogoSize().


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