21#include <commoncontrols.h>
29#define IDS_MENU_EMPTY 34561
34#define USE_TBSTYLE_EX_VERTICAL 0
37#define TIMERID_HOTTRACK 1
41 return (sfgao & SFGAO_STREAM) ? SFGAO_STREAM : (sfgao & SFGAO_FOLDER);
124 TRACE(
"WM_NOTIFY unknown code %d, %d\n",
hdr->code,
hdr->idFrom);
129 if (
wParam == SPI_SETFLATMENU)
143 TRACE(
"DisableMouseTrack %d\n", bDisable);
165 bool isHot, isPopup, isActive;
246 btni.cbSize =
sizeof(btni);
283 m_useFlatMenus(
FALSE),
284 m_disableMouseTrack(
FALSE),
285 m_timerEnabled(
FALSE),
286 m_menuBand(menuBand),
289 m_usePager(usePager),
294 m_isTrackingPopup(
FALSE),
295 m_cancelingPopup(
FALSE)
344 if ((
m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL)
401#if USE_TBSTYLE_EX_VERTICAL
443 m_pager.SubclassWindow(hwndPager);
468 TRACE(
"Sizes out of date, recalculating.\n");
479 TRACE(
"Ideal Size: (%d, %d) for %d buttons\n",
m_idealSize, GetButtonCount());
514 DWORD btnSize = GetButtonSize();
523 if (m_hWnd && m_hWnd ==
hwnd)
return S_OK;
546 INT iItem = tip->iItem;
608 TRACE(
"Hot item change prevented by DisableMouseTrack\n");
613 if (
m_hotBar ==
this && toolbar !=
this)
694 if (!GetButton(
idx, &btn))
719 if (!GetButton(
idx, &btn))
722 TRACE(
"ChangeTrackedItem %d, %d\n",
idx, wasTracking);
732 if (!GetItemRect(
index, &rc))
773 if (!GetItemRect(
index, &rc))
817 TRACE(
"BeforeCancelPopup\n");
825 TRACE(
"Item click prevented by DisableMouseTrack\n");
832 TRACE(
"OnCommand cancelled because it was tracking submenu.\n");
838 TRACE(
"PopupItem returned S_OK\n");
842 TRACE(
"Executing...\n");
864 GetButton(iIndex, &btn);
890 GetButton(iIndex, &btn);
920 if (dwSelectType != 0xFFFFFFFF)
922 int count = GetButtonCount();
929 else if (dwSelectType ==
VK_END)
932 dwSelectType =
VK_UP;
946 if (dwSelectType ==
VK_UP)
950 else if (dwSelectType ==
VK_DOWN)
957 if (dwSelectType ==
VK_UP)
961 else if (dwSelectType ==
VK_DOWN)
993 if (dwSelectType ==
VK_UP)
997 else if (dwSelectType ==
VK_DOWN)
1008 TRACE(
"Setting Hot item to null\n");
1020#if !USE_TBSTYLE_EX_VERTICAL
1026 if (hasSubMenu && (
m_initFlags & SMINIT_VERTICAL))
1040 if (!AddButtons(1, &tbb))
1050#if !USE_TBSTYLE_EX_VERTICAL
1059 if (!AddButtons(1, &tbb))
1068 WCHAR MenuString[128];
1079 if (!AddButtons(1, &tbb))
1087 while (DeleteButton(0))
1111 int index = GetButtonInfo(iItem, &
info);
1155 TRACE(
"PopupItem non-vertical %d %d\n",
index, iItem);
1214 for (
i = 0;
i < ic;
i++)
1226 TRACE(
"Error obtaining info for menu item at pos=%d\n",
i);
1272 delete reinterpret_cast<SMINFO*
>(
tb->tbButton.dwData);
1278 CComPtr<IContextMenu> contextMenu;
1280 reinterpret_cast<WPARAM>(&IID_IContextMenu),
reinterpret_cast<LPARAM>(&contextMenu));
1304 CComPtr<IShellMenu> shellMenu;
1320 m_shellFolder(
NULL),
1360 CComPtr<IEnumIDList> eidl;
1395 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
1399 TRACE(
"StartMenuAdminTools: %d\n", StartMenuAdminTools);
1400 TRACE(
"bMustHideAdminTools: %d\n", bMustHideAdminTools);
1403 if (bMustHideAdminTools)
1406 szAdminTools,
_countof(szAdminTools));
1424 if (bMustHideAdminTools &&
lstrcmpiW(MenuString, szAdminTools) == 0)
1492 ERR(
"ILClone failed!\n");
1507 CComPtr<IContextMenu> contextMenu =
NULL;
1532 CComPtr<IShellMenuCallback> psmc;
1533 CComPtr<IShellMenu> shellMenu;
1547 hr = shellMenu->Initialize(psmc, 0, uId, SMINIT_VERTICAL);
1551 CComPtr<IShellFolder> childFolder;
1556 hr = shellMenu->SetShellFolder(childFolder,
NULL,
NULL, SMSET_TOP);
#define IID_PPV_ARG(Itype, ppType)
#define WINE_DEFAULT_DEBUG_CHANNEL(t)
HRESULT _CallCBWithItemPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT _OnPopupSubMenu(IShellMenu *childShellMenu, POINTL *pAt, RECTL *pExclude, BOOL mouseInitiated)
HRESULT _GetTopLevelWindow(HWND *topLevel)
HRESULT _TrackContextMenu(IContextMenu *popup, INT x, INT y)
HRESULT _TrackSubMenu(HMENU popup, INT x, INT y, RECT &rcExclude)
HRESULT _KillPopupTimers()
HRESULT _MenuItemSelect(DWORD changeType)
HRESULT _CancelCurrentPopup()
HRESULT _CallCBWithItemId(UINT Id, UINT uMsg, WPARAM wParam, LPARAM lParam)
HRESULT _ChangeHotItem(CMenuToolbarBase *tb, INT id, DWORD dwFlags)
HRESULT AdjustForTheme(BOOL bFlatStyle)
HRESULT _ChangePopupItem(CMenuToolbarBase *tb, INT id)
STDMETHOD() GetMenuInfo(IShellMenuCallback **ppsmc, UINT *puId, UINT *puIdAncestor, DWORD *pdwFlags) override
void WINAPI CoTaskMemFree(void *ptr)
BOOL WINAPI DPA_Sort(HDPA hdpa, PFNDPACOMPARE pfnCompare, LPARAM lParam)
BOOL WINAPI DPA_Destroy(HDPA hdpa)
HDPA WINAPI DPA_Create(INT nGrow)
#define HeapFree(x, y, z)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
BOOL WINAPI SHRegGetBoolUSValueW(const WCHAR *subkey, const WCHAR *value, BOOL ignore_hkcu, BOOL default_value)
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
#define FAILED_UNEXPECTEDLY
BOOL WINAPI IsAppThemed(void)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
static IShellFolder IShellItem **static IBindCtx LPITEMIDLIST SFGAOF
GLint GLint GLint GLint GLint x
GLuint GLuint GLsizei count
GLint GLint GLint GLint GLint GLint y
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLboolean GLboolean GLboolean b
GLboolean GLboolean GLboolean GLboolean a
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
int WINAPI SHMapPIDLToSystemImageListIndex(IShellFolder *sh, LPCITEMIDLIST pidl, int *pIndex)
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
static const LARGE_INTEGER *static const HANDLE const LARGE_INTEGER *static PSLIST_ENTRY PSLIST_ENTRY last
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
static VOID SetImageList(HWND hwnd)
_Out_ PULONG _Out_ PULONG pIndex
_In_ LPWSTR _In_ DWORD _In_ DWORD _In_ DWORD dwFlags
static HANDLE ULONG_PTR dwData
LPITEMIDLIST WINAPI ILClone(LPCITEMIDLIST pidl)
void WINAPI ILFree(LPITEMIDLIST pidl)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
#define NM_RELEASEDCAPTURE
#define CDDS_ITEMPOSTPAINT
_Out_opt_ int _Out_opt_ int * cy
#define CDDS_ITEMPREPAINT
#define CDRF_NOTIFYITEMDRAW
#define TBN_HOTITEMCHANGE
#define NM_TOOLTIPSCREATED
#define CDRF_NOTIFYPOSTPAINT
#define TBSTYLE_EX_DOUBLEBUFFER
#define TBCDRF_NOBACKGROUND
#define TBSTYLE_TRANSPARENT
#define TBSTYLE_REGISTERDROP
#define DPA_AppendPtr(hdpa, pitem)
#define CCS_NOPARENTALIGN
#define DPA_GetPtrCount(hdpa)
#define TBSTYLE_CUSTOMERASE
#define TBSTYLE_EX_VERTICAL
#define TBN_DELETINGBUTTON
DWORD WINAPI GetSysColor(_In_ int)
BOOL WINAPI IsWindow(_In_opt_ HWND)
BOOL WINAPI ShowWindow(_In_ HWND, _In_ int)
DWORD WINAPI GetMessagePos(void)
HWND WINAPI GetForegroundWindow(void)
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetWindowPos(_In_ HWND, _In_opt_ HWND, _In_ int, _In_ int, _In_ int, _In_ int, _In_ UINT)
HWND WINAPI SetParent(_In_ HWND, _In_opt_ HWND)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HMENU WINAPI GetSubMenu(_In_ HMENU, _In_ int)
#define COLOR_HIGHLIGHTTEXT
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)
#define SystemParametersInfo
BOOL WINAPI DestroyWindow(_In_ HWND)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
static SFGAOF SHELL_GetAttributesOf(IShellFolder *psf, LPCITEMIDLIST pidlChild, SFGAOF query)
#define CSIDL_COMMON_PROGRAMS
#define IDS_ADMINISTRATIVETOOLS
ITEMIDLIST UNALIGNED * LPITEMIDLIST
const ITEMIDLIST_RELATIVE UNALIGNED * PCUIDLIST_RELATIVE
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
TW_UINT32 TW_UINT16 TW_UINT16 TW_MEMREF pData
HRESULT WINAPI SetWindowTheme(_In_ HWND hwnd, _In_ LPCWSTR pszSubAppName, _In_ LPCWSTR pszSubIdList)
DWORD WINAPI GetLastError(void)
#define SubclassWindow(hwnd, lpfn)
static HRESULT HRESULT_FROM_WIN32(unsigned int x)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
#define OUT_DEFAULT_PRECIS
#define CLIP_DEFAULT_PRECIS
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
COLORREF WINAPI SetTextColor(_In_ HDC, _In_ COLORREF)
#define IID_NULL_PPV_ARG(Itype, ppType)