38#include "../dialogs/searchprogram.h"
39#include "../dialogs/settings.h"
42#define SHELLPATH_CONTROL_PANEL TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}")
43#define SHELLPATH_PRINTERS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}")
44#define SHELLPATH_NET_CONNECTIONS TEXT("::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{7007ACC7-3202-11D1-AAD2-00805FC1270E}")
65#ifdef _LIGHT_STARTMENU
73 _create_info(create_info),
94#ifdef _LIGHT_STARTMENU
112 return s_wcStartMenu;
137#ifndef _LIGHT_STARTMENU
175 bool hasSubmenu =
false;
181#ifdef _LIGHT_STARTMENU
182 _buttons.push_back(SMBtnInfo(sme, it->first, hasSubmenu));
188#ifdef _LIGHT_STARTMENU
189 if (_buttons.empty())
195#ifdef _LIGHT_STARTMENU
199#ifdef _LAZY_ICONEXTRACT
218#ifdef _LAZY_ICONEXTRACT
237 if (
p>
path && (
p[-1]==
'\\' ||
p[-1]==
'/'))
248 if (!ignore.empty()) {
251 _tcscat(ignore_path, ignore_dir);
252 _tcscat(ignore_name, ignore_ext);
262 lwr_filter.toLower();
267 if (
entry->_shell_attribs & SFGAO_HIDDEN)
272 if (*ignore_name && !
_tcsicmp(
entry->_data.cFileName, ignore_name))
287 if (!
_tcsstr(lwr_name,lwr_filter) && !
_tcsstr(lwr_disp,lwr_filter))
303 PaintCanvas canvas(_hwnd);
348 WindowRect
pos(_hwnd);
355#ifdef _LIGHT_STARTMENU
377#ifdef _LIGHT_STARTMENU
385#ifdef _LIGHT_STARTMENU
388 if (
lparam != _last_mouse_pos) {
392 RECT rect_up, rect_down;
417 int new_id = ButtonHitTest(
pt);
419 if (new_id>0 && new_id!=_selected_id)
420 SelectButton(new_id);
460#ifdef _LAZY_ICONEXTRACT
480 SelectButtonIndex(0,
wparam!=0);
483#ifdef _LIGHT_STARTMENU
488 int id = ButtonHitTest(clnt_pt);
514#ifdef _LIGHT_STARTMENU
516int StartMenu::ButtonHitTest(
POINT pt)
518 ClientRect clnt(_hwnd);
525 for(SMBtnVector::const_iterator it=_buttons.begin()+
_scroll_pos; it!=_buttons.end(); ++it) {
526 const SMBtnInfo&
info = *it;
545void StartMenu::InvalidateSelection()
547 if (_selected_id <= 0)
550 ClientRect clnt(_hwnd);
554 for(SMBtnVector::const_iterator it=_buttons.begin()+
_scroll_pos; it!=_buttons.end(); ++it) {
555 const SMBtnInfo&
info = *it;
559 if (
info._id == _selected_id) {
568const SMBtnInfo* StartMenu::GetButtonInfo(
int id)
const
570 for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it)
577bool StartMenu::SelectButton(
int id,
bool open_sub)
582 if (
id == _selected_id)
585 InvalidateSelection();
587 const SMBtnInfo* btn = GetButtonInfo(
id);
589 if (btn && btn->_enabled) {
592 InvalidateSelection();
595 if (btn->_hasSubmenu) {
608bool StartMenu::OpenSubmenu(
bool select_first)
610 if (_selected_id == -1)
613 InvalidateSelection();
615 const SMBtnInfo* btn = GetButtonInfo(_selected_id);
618 if (btn->_hasSubmenu) {
632int StartMenu::GetSelectionIndex()
634 if (_selected_id == -1)
637 for(
int i=0;
i<(
int)_buttons.size(); ++
i)
638 if (_buttons[
i]._id == _selected_id)
644bool StartMenu::SelectButtonIndex(
int idx,
bool open_sub)
646 if (
idx>=0 &&
idx<(
int)_buttons.size())
647 return SelectButton(_buttons[
idx]._id, open_sub);
652void StartMenu::ProcessKey(
int vk)
669 SelectButtonIndex(0,
false);
673 SelectButtonIndex(_buttons.size()-1,
false);
692 if (
vk>=
'0' &&
vk<=
'Z')
693 JumpToNextShortcut(
vk);
697bool StartMenu::Navigate(
int step)
699 int idx = GetSelectionIndex();
706 idx = _buttons.size() - step;
712 if (_buttons.size()<=1 && (idx<0 || idx>(
int)_buttons.size()))
716 idx += _buttons.size();
718 if (
idx > (
int)_buttons.size())
719 idx -= _buttons.size()+1;
721 if (SelectButtonIndex(
idx,
false))
728bool StartMenu::JumpToNextShortcut(
char c)
730 int cur_idx = GetSelectionIndex();
738 SMBtnVector::const_iterator cur_it = _buttons.begin();
739 cur_it += cur_idx + 1;
742 SMBtnVector::const_iterator it = cur_it;
743 for(; it!=_buttons.end(); ++it) {
744 const SMBtnInfo& btn = *it;
746 if (!btn._title.empty() &&
toupper((TBYTE)btn._title.at(0)) ==
c) {
748 first_found = btn._id;
755 it = _buttons.begin();
756 for(; it!=_buttons.end() && it!=cur_it; ++it) {
757 const SMBtnInfo& btn = *it;
759 if (!btn._title.empty() &&
toupper((TBYTE)btn._title.at(0)) ==
c) {
761 first_found = btn._id;
768 SelectButton(first_found);
783#ifdef _LIGHT_STARTMENU
784 ClientRect clnt(_hwnd);
788 for(SMBtnVector::const_iterator it=_buttons.begin()+
_scroll_pos; it!=_buttons.end(); ++it) {
789 const SMBtnInfo&
info = *it;
793 if (
info._id ==
id) {
820 ClientRect clnt(_hwnd);
843 ClientRect clnt(_hwnd);
855 *prect_down = *prect_up;
875#ifdef _LIGHT_STARTMENU
879 ClientRect clnt(_hwnd);
883 int sep_width =
rect.right-
rect.left - 4;
888 for(SMBtnVector::const_iterator it=_buttons.begin()+
_scroll_pos; it!=_buttons.end(); ++it) {
889 const SMBtnInfo& btn = *it;
891 if (
rect.top > canvas.rcPaint.bottom)
911 if (
rect.top >= canvas.rcPaint.top)
920#ifdef _LAZY_ICONEXTRACT
925#ifdef _SINGLE_ICONEXTRACT
931 SMBtnInfo& btn = _buttons[
idx];
954 WindowCanvas canvas(_hwnd);
972 int icons_extracted = 0;
973 int icons_updated = 0;
981 if (icons_extracted) {
986 sme._hIcon = (
HICON)-1;
989 const Entry* sm_entry = *it2;
991 if (sm_entry->_hIcon) {
992 sme._hIcon = sm_entry->_hIcon;
999 for(SMBtnVector::iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
1000 SMBtnInfo&
info = *it;
1009 if (icons_updated) {
1024 ClientRect rt(
ctrl);
1026 if (rt.right !=
cx) {
1027 int height = rt.bottom - rt.top;
1043#ifndef _LIGHT_STARTMENU
1059#ifndef _LIGHT_STARTMENU
1092 sme->second._entries.insert(
entry);
1139#ifdef _LIGHT_STARTMENU
1140 _buttons.push_back(SMBtnInfo(
title, icon_id,
id, hasSubmenu,
enabled));
1144 WindowRect
rect(_hwnd);
1145 ClientRect clnt(_hwnd);
1156 WindowCanvas canvas(_hwnd);
1163 if (text_width >
cx)
1164 rect.right += text_width-
cx;
1175#ifdef _LIGHT_STARTMENU
1178 WindowRect
rect(_hwnd);
1179 ClientRect clnt(_hwnd);
1236 _buttons[GetSelectionIndex()]._enabled =
false;
1255 if (!new_folders.
empty()) {
1260 _buttons[GetSelectionIndex()]._enabled =
false;
1281 WindowRect
pos(_hwnd);
1330 shexinfo.
hwnd = hparent;
1350 if (!new_folders.
empty()) {
1379#ifdef _LIGHT_STARTMENU
1383 bool hasSubmenu,
bool enabled,
bool has_focus,
bool pushed,
int icon_size);
1419 if (btn._hasSubmenu) {
1424 has_focus? selArrowIcon: arrowIcon,
1441#ifdef _LIGHT_STARTMENU
1443void StartMenu::ResizeToButtons()
1445 WindowRect
rect(_hwnd);
1447 WindowCanvas canvas(_hwnd);
1455 for(SMBtnVector::const_iterator it=_buttons.begin(); it!=_buttons.end(); ++it) {
1468 int text_width = max_width +
icon_size + 10 + 16;
1488 if (
rect.bottom > cyscreen) {
1494 bottom_max =
rect.bottom;
1596 WindowRect
pos(hwndOwner);
1603#ifndef _LIGHT_STARTMENU
1629#ifdef _LIGHT_STARTMENU
1633#ifdef _LIGHT_STARTMENU
1748#ifdef _LIGHT_STARTMENU
1769 PaintCanvas canvas(_hwnd);
1773 case WM_DISPLAYCHANGE:
1789 BitmapSelection sel(mem_dc,
bmp);
1791 ClientRect clnt(_hwnd);
1808 WindowCanvas
dc(_hwnd);
1814 else if (clr_bits > 4)
1844 super::ProcessKey(
vk);
1878#ifndef _SHELL32_FAVORITES
1938 bool mdi = XMLBool(explorer_options,
"mdi",
true);
1941 MDIMainFrame::Create(
TEXT(
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
1944 SDIMainFrame::Create(
TEXT(
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}"), 0);
1960 bool mdi = XMLBool(explorer_options,
"mdi",
true);
1963 MDIMainFrame::Create(
TEXT(
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
1966 SDIMainFrame::Create(
TEXT(
"::{20D04FE0-3AEA-1069-A2D8-08002B30309D}\\::{21EC2020-3AEA-1069-A2DD-08002B30309D}\\::{2227A280-3AEA-1069-A2DE-08002B30309D}"), 0);
2001 bool mdi = XMLBool(explorer_options,
"mdi",
true);
2092#ifndef TASKBAR_AT_TOP
2119 (*LogoffWindowsDialog)(0);
2133 (*ExitWindowsDialog)(hwndOwner);
2140 static DynamicFct<RESTARTWINDOWSDLG> RestartDlg(
TEXT(
"SHELL32"), 59);
2143 (*RestartDlg)(hwndOwner, (
LPWSTR)
L"You selected restart.\n\n",
flags);
2152#if defined(ROSSHELL) || defined(__REACTOS__)
2178#if defined(ROSSHELL) || defined(__REACTOS__)
2206 if (!
dir._scanned) {
2209#ifdef _LAZY_ICONEXTRACT
2222#ifndef _SHELL32_FAVORITES
2229 lwr_filter.toLower();
2251 if (!lwr_filter.empty()) {
pair< _T1, _T2 > _STLP_CALL make_pair(_T1 __x, _T2 __y)
VOID WaitCursor(BOOL bBegin)
DWORD GetPixel(LPDIRECTDRAWSURFACE7 Surface, UINT x, UINT y)
void push_back(const_reference __x)
_STLP_PRIV _List_iterator< ShellPath, _Const_traits< ShellPath > > const_iterator
_STLP_PRIV _List_iterator< StartMenuDirectory, _Nonconst_traits< StartMenuDirectory > > iterator
_STLP_TEMPLATE_FOR_CONT_EXT iterator find(const _KT &__x)
pair< iterator, bool > insert(const value_type &__x)
_Rep_type::iterator iterator
_Rep_type::const_iterator const_iterator
pair< iterator, bool > insert(const value_type &__x)
_Rep_type::const_iterator const_iterator
_Rep_type::iterator iterator
#define IDC_SEARCH_COMPUTER
#define IDC_SETTINGS_MENU
#define IDC_PRINTERS_MENU
#define IDC_SEARCH_PROGRAM
#define IDC_CONTROL_PANEL
#define DESKTOPBARBAR_HEIGHT
EXTERN_C int WINAPI LogoffWindowsDialog(HWND hWndOwner)
void WINAPI ExitWindowsDialog(HWND hWndOwner)
void WINAPI RunFileDlg(HWND hWndOwner, HICON hIcon, LPCWSTR lpstrDirectory, LPCWSTR lpstrTitle, LPCWSTR lpstrDescription, UINT uFlags)
EXTERN_C BOOL WINAPI SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
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)
@ SCAN_DONT_EXTRACT_ICONS
void ShowExitWindowsDialog(HWND hwndOwner)
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
GLubyte GLubyte GLubyte GLubyte w
GLfloat GLfloat GLfloat GLfloat h
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
void ExplorerPropertySheet(HWND hparent)
ExplorerGlobals g_Globals
void explorer_show_frame(int cmdShow, LPTSTR lpCmdLine)
#define ICF_FROM_ICON_SIZE(size)
#define IDD_SEARCH_PROGRAM
#define IDS_DESKTOPBAR_SETTINGS
#define IDI_ARROW_SELECTED
#define ID_DESKTOPBAR_SETTINGS
#define IDS_SEARCH_COMPUTER
#define IDS_SETTINGS_MENU
#define IDS_CONTROL_PANEL
void MoveVisible(HWND hwnd)
BOOL launch_file(HWND hwnd, LPCTSTR cmd, UINT nCmdShow, LPCTSTR parameters)
void display_error(HWND hwnd, DWORD error)
#define WINDOW_CREATOR_INFO(WND_CLASS, INFO_CLASS)
#define WINDOW_CREATOR(WND_CLASS)
#define WINDOW_DYNAMIC_CAST(CLASS, hwnd)
#define FILE_ATTRIBUTE_DIRECTORY
_Out_opt_ int _Out_opt_ int * cy
#define RFF_CALCDIRECTORY
SHELLEXECUTEINFOA SHELLEXECUTEINFO
ShellFolder & GetDesktopFolder()
void HandleException(COMException &e, HWND hwnd)
Exception Handler for COM exceptions.
void WINAPI SHAddToRecentDocs(UINT uFlags, LPCVOID pv)
BOOL WINAPI SHFindFiles(PCIDLIST_ABSOLUTE pidlFolder, PCIDLIST_ABSOLUTE pidlSaveFile)
#define CSIDL_COMMON_STARTMENU
#define CSIDL_COMMON_PROGRAMS
#define CSIDL_COMMON_FAVORITES
#define CSIDL_COMMON_ADMINTOOLS
DWORD WINAPI SHRestricted(RESTRICTIONS rest)
window class with gray background color
Exception with context information.
static int DoModal(UINT nid, CREATORFUNC creator, HWND hwndParent=0)
base of all file and directory entries
CtxMenuInterfaces _cm_ifs
LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam)
Dialog to work with the complete list of start menu entries.
const Icon & extract(LPCTSTR path, ICONCACHE_FLAGS flags=ICF_NORMAL)
const Icon & get_icon(int icon_id)
void draw(HDC hdc, int x, int y, int cx, int cy, COLORREF bk_color, HBRUSH bk_brush) const
convenient loading of bitmap resources
convenient loading of icon resources with specified sizes
convenient loading of string resources
shell file/directory entry
IShellFolder smart pointer.
wrapper class for item ID lists
file system path of special folder
Retrieval of special shell folder paths.
Handling of standard start menu commands.
static void ShowLaunchDialog(HWND hwndOwner)
static void ShowRestartDialog(HWND hwndOwner, UINT flags)
static void ShowSearchComputer()
static void ShowSearchDialog()
int Command(int id, int code)
static void ShowLogoffDialog(HWND hwndOwner)
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)
LRESULT SendParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
virtual int Command(int id, int code)
LRESULT PostParent(UINT nmsg, WPARAM wparam=0, LPARAM lparam=0)
static BOOL pretranslate_msg(LPMSG pmsg)
virtual LRESULT Init(LPCREATESTRUCT pcs)
static BOOL dispatch_dialog_msg(LPMSG pmsg)
TW_UINT32 TW_UINT16 TW_UINT16 MSG
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
DWORD WINAPI GetLastError(void)
void DrawGrayText(HDC hdc, LPRECT pRect, LPCTSTR title, int dt_flags)
#define GetWindowExStyle(hwnd)
#define SelectBrush(hdc, hbr)
#define GetWindowStyle(hwnd)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
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)
HWND WINAPI GetFocus(void)
HWND WINAPI SetCapture(_In_ HWND hWnd)
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI TranslateMessage(_In_ const MSG *)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
BOOL WINAPI ReleaseCapture(void)
BOOL WINAPI GetWindowRect(_In_ HWND, _Out_ LPRECT)
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)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BOOL WINAPI SetForegroundWindow(_In_ HWND)
BOOL WINAPI AdjustWindowRectEx(_Inout_ LPRECT, _In_ DWORD, _In_ BOOL, _In_ DWORD)
BOOL WINAPI EndDeferWindowPos(_In_ HDWP)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI SetFocus(_In_opt_ HWND)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
BOOL WINAPI UpdateWindow(_In_ HWND)
#define COLOR_HIGHLIGHTTEXT
#define GetNextWindow(h, c)
HWND WINAPI GetParent(_In_ HWND)
HWND WINAPI GetWindow(_In_ HWND, _In_ UINT)
int WINAPI GetDlgCtrlID(_In_ HWND)
HDWP WINAPI DeferWindowPos(_In_ HDWP, _In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define COLOR_BTNHIGHLIGHT
BOOL WINAPI IsWindowVisible(_In_ HWND)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI MoveWindow(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ BOOL)
HDWP WINAPI BeginDeferWindowPos(_In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)