ReactOS  0.4.12-dev-75-g00dd17e
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 More...
 
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)
 

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 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 ()
 

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 ()
 
- Protected Member Functions inherited from StartMenu
void ResizeButtons (int cx)
 
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)
 
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 int Notify (int id, NMHDR *pnmh)
 

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
 

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 More...
 
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),
1559  _hwndStartButton(0)
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
const CHAR * LPCTSTR
Definition: xmlstorage.h:193
file system path of special folder
HWND _hwndStartButton
Definition: startmenu.h:376
Retrieval of special shell folder paths.
Definition: shellclasses.h:981
StartMenuShellDirs _dirs
Definition: startmenu.h:232
shell folder entry
Definition: shellfs.h:53
#define CSIDL_COMMON_PROGRAMS
Definition: shlobj.h:2010
Exception with context information.
Definition: shellclasses.h:113
#define CSIDL_COMMON_STARTMENU
Definition: shlobj.h:2009
void ReadLogoSize()
Definition: startmenu.cpp:1581
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
StartMenuDirectory is used to store the base directory of start menus.
Definition: startmenu.h:52
ShellFolder & GetDesktopFolder()
StartMenuHandler super
Definition: startmenu.h:366
#define CSIDL_STARTMENU
Definition: shlobj.h:1999
#define CSIDL_PROGRAMS
Definition: shlobj.h:1990
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:825

Member Function Documentation

◆ AddEntries()

void StartMenuRoot::AddEntries ( )
protectedvirtual

Reimplemented from StartMenu.

Definition at line 1757 of file startmenu.cpp.

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

◆ 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.

Referenced by StartMenuHandler::Command(), FavoritesMenu::Command(), and TrackStartmenu().

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

◆ 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

◆ Create()

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

Definition at line 1608 of file startmenu.cpp.

Referenced by DesktopBar::Init().

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 WS_THICKFRAME
Definition: pedump.c:630
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
#define WS_CLIPCHILDREN
Definition: pedump.c:619
LONG right
Definition: windef.h:298
& rect
Definition: startmenu.cpp:1413
#define TITLE_STARTMENU
Definition: startmenu.h:30
static BtnWindowClass & GetWndClasss()
Definition: startmenu.cpp:108
static void CalculateStartPos(HWND hwndOwner, RECT &rect, int icon_size)
Definition: startmenu.cpp:1594
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
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
Definition: window.h:215
#define WS_POPUP
Definition: pedump.c:616
LONG bottom
Definition: windef.h:299
Startmenu root window.
Definition: startmenu.h:364
iconPos iconPos icon_size
Definition: startmenu.cpp:1416

◆ GetLogoResId()

UINT StartMenuRoot::GetLogoResId ( )
protected

Definition at line 1806 of file startmenu.cpp.

Referenced by Paint(), and ReadLogoSize().

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 }
#define BITSPIXEL
Definition: wingdi.h:718
HDC dc
Definition: cylfrac.c:34
#define IDB_LOGOV16
Definition: resource.h:115
#define IDB_LOGOV
Definition: resource.h:75
#define IDB_LOGOV256
Definition: resource.h:76
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)

◆ 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 IDC_BROWSE
Definition: resource.h:21
#define IDC_FAVORITES
Definition: desktopbar.h:48
#define IDC_PROGRAMS
Definition: desktopbar.h:49
#define IDC_RECENT
Definition: desktopbar.h:47
#define IDS_FAVORITES
Definition: resource.h:31
#define IDS_SETTINGS
Definition: resource.h:15
#define IDC_SEARCH
Definition: desktopbar.h:60
#define IDS_LOGOFF
Definition: resource.h:7
#define IDS_START_HELP
Definition: resource.h:10
#define IDS_PROGRAMS
Definition: resource.h:69
#define IDC_TERMINATE
Definition: desktopbar.h:61
#define IDS_LAUNCH
Definition: resource.h:9
#define IDS_TERMINATE
Definition: resource.h:49
#define IDC_DOCUMENTS
Definition: desktopbar.h:46
void AddSeparator()
Definition: startmenu.cpp:1173
#define IDS_BROWSE
Definition: resource.h:27
#define IDS_RECENT
Definition: shresdef.h:81
#define IDC_SETTINGS
Definition: desktopbar.h:44
ExplorerGlobals g_Globals
Definition: explorer.cpp:52
void AddButton(LPCTSTR title, ICON_ID icon_id=ICID_NONE, bool hasSubmenu=false, int id=-1, bool enabled=true)
Definition: startmenu.cpp:1137
#define IDC_LOGOFF
Definition: desktopbar.h:38
LRESULT Init(LPCREATESTRUCT pcs)
Definition: startmenu.cpp:164
#define IDS_RESTART
Definition: resource.h:48
#define IDS_SHUTDOWN
Definition: resource.h:8
#define IDS_DOCUMENTS
Definition: resource.h:12
#define IDC_LAUNCH
Definition: desktopbar.h:40
#define IDC_START_HELP
Definition: desktopbar.h:41
#define IDC_RESTART
Definition: desktopbar.h:62
convenient loading of string resources
Definition: globals.h:303
#define IDC_SHUTDOWN
Definition: desktopbar.h:39
DWORD WINAPI SHRestricted(RESTRICTIONS policy)
Definition: shpolicy.c:825
#define IDS_SEARCH
Definition: resource.h:30

◆ IsStartMenuVisible()

bool StartMenuRoot::IsStartMenuVisible ( ) const

Definition at line 1829 of file startmenu.cpp.

1830 {
1831  return IsWindowVisible(_hwnd) != FALSE;
1832 }
BOOL WINAPI IsWindowVisible(_In_ HWND)

◆ Paint()

void StartMenuRoot::Paint ( PaintCanvas &  canvas)
protected

Definition at line 1785 of file startmenu.cpp.

Referenced by WndProc().

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 }
SIZE _logo_size
Definition: startmenu.h:382
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
Definition: blt.cpp:2
static VOID NTAPI BitBlt(IN ULONG Left, IN ULONG Top, IN ULONG Width, IN ULONG Height, IN PUCHAR Buffer, IN ULONG BitsPerPixel, IN ULONG Delta)
Definition: vga.c:416
& rect
Definition: startmenu.cpp:1413
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
LONG cx
Definition: windef.h:324
BITMAP bmp
Definition: alphablend.c:62
UINT GetLogoResId()
Definition: startmenu.cpp:1806
convenient loading of bitmap resources
Definition: globals.h:345
#define WHITENESS
Definition: wingdi.h:335
#define min(a, b)
Definition: monoChain.cc:55
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
void Paint(PaintCanvas &canvas)
Definition: startmenu.cpp:870
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
LONG cy
Definition: windef.h:325
#define SRCCOPY
Definition: wingdi.h:331

◆ 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 }
WindowHandle _submenu
Definition: startmenu.h:235
#define VK_LEFT
Definition: winuser.h:2178
bool CloseOtherSubmenus(int id=0)
Definition: startmenu.cpp:1197

◆ ReadLogoSize()

void StartMenuRoot::ReadLogoSize ( )
protected

Definition at line 1581 of file startmenu.cpp.

Referenced by StartMenuRoot(), and WndProc().

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
1590  _border_left = _logo_size.cx + 1;
1591 }
SIZE _logo_size
Definition: startmenu.h:382
LONG cx
Definition: windef.h:324
int _border_left
Definition: startmenu.h:237
#define GetObject
Definition: wingdi.h:4445
UINT GetLogoResId()
Definition: startmenu.cpp:1806
convenient loading of bitmap resources
Definition: globals.h:345
Definition: bl.h:1331
LONG cy
Definition: windef.h:325

◆ 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
1645  ShowWindow(hwnd, SW_SHOW);
1646  SetForegroundWindow(hwnd);
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) {
1666  CloseStartMenu();
1667  break;
1668  }
1669  }
1670 
1671  try {
1672  if (pretranslate_msg(&msg))
1673  continue;
1674 
1675  if (dispatch_dialog_msg(&msg))
1676  continue;
1677 
1678  TranslateMessage(&msg);
1679 
1680  try {
1681  DispatchMessage(&msg);
1682  } catch(COMException& e) {
1683  HandleException(e, _hwnd);
1684  }
1685  } catch(COMException& e) {
1686  HandleException(e, _hwnd);
1687  }
1688  }
1689 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define DispatchMessage
Definition: winuser.h:5631
BOOL WINAPI TranslateMessage(_In_ const MSG *)
#define WM_LBUTTONDOWN
Definition: winuser.h:1752
int _icon_size
Definition: startmenu.h:251
HWND _hwndStartButton
Definition: startmenu.h:376
BOOL WINAPI IsWindow(_In_opt_ HWND)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
Definition: twain.h:1827
LONG top
Definition: windef.h:297
LONG left
Definition: windef.h:296
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
LONG right
Definition: windef.h:298
& rect
Definition: startmenu.cpp:1413
Exception with context information.
Definition: shellclasses.h:113
#define e
Definition: ke_i.h:82
static void CalculateStartPos(HWND hwndOwner, RECT &rect, int icon_size)
Definition: startmenu.cpp:1594
void CloseStartMenu(int id=0)
close all windows of the start menu popup
Definition: startmenu.cpp:1821
smooth NULL
Definition: ftsmooth.c:416
#define SW_SHOW
Definition: winuser.h:769
#define WM_RBUTTONDOWN
Definition: winuser.h:1755
#define WINDOW_DYNAMIC_CAST(CLASS, hwnd)
Definition: window.h:166
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
static BOOL pretranslate_msg(LPMSG pmsg)
Definition: window.cpp:589
HWND WINAPI GetParent(_In_ HWND)
#define WM_MBUTTONDOWN
Definition: winuser.h:1758
#define GetMessage
Definition: winuser.h:5656
#define msg(x)
Definition: auth_time.c:54
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
LONG bottom
Definition: windef.h:299
static BOOL dispatch_dialog_msg(LPMSG pmsg)
Definition: window.cpp:619
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)

◆ 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 }
void Paint(PaintCanvas &canvas)
Definition: startmenu.cpp:1785
void ReadLogoSize()
Definition: startmenu.cpp:1581
#define WM_PAINT
Definition: winuser.h:1602
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Definition: startmenu.cpp:299
UINT WPARAM LPARAM lparam
Definition: msvc.h:92
UINT WPARAM wparam
Definition: msvc.h:92

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: