21#include <commoncontrols.h>
29#define IDS_MENU_EMPTY 34561
34#define USE_TBSTYLE_EX_VERTICAL 0
37#define TIMERID_HOTTRACK 1
114 TRACE(
"WM_NOTIFY unknown code %d, %d\n",
hdr->code,
hdr->idFrom);
119 if (
wParam == SPI_SETFLATMENU)
133 TRACE(
"DisableMouseTrack %d\n", bDisable);
155 bool isHot, isPopup, isActive;
236 btni.cbSize =
sizeof(btni);
273 m_useFlatMenus(
FALSE),
274 m_disableMouseTrack(
FALSE),
275 m_timerEnabled(
FALSE),
276 m_menuBand(menuBand),
279 m_usePager(usePager),
284 m_isTrackingPopup(
FALSE),
285 m_cancelingPopup(
FALSE)
334 if ((
m_initFlags & (SMINIT_TOPLEVEL | SMINIT_VERTICAL)) == SMINIT_TOPLEVEL)
391#if USE_TBSTYLE_EX_VERTICAL
433 m_pager.SubclassWindow(hwndPager);
458 TRACE(
"Sizes out of date, recalculating.\n");
469 TRACE(
"Ideal Size: (%d, %d) for %d buttons\n",
m_idealSize, GetButtonCount());
504 DWORD btnSize = GetButtonSize();
513 if (m_hWnd && m_hWnd ==
hwnd)
return S_OK;
536 INT iItem = tip->iItem;
598 TRACE(
"Hot item change prevented by DisableMouseTrack\n");
603 if (
m_hotBar ==
this && toolbar !=
this)
684 if (!GetButton(
idx, &btn))
709 if (!GetButton(
idx, &btn))
712 TRACE(
"ChangeTrackedItem %d, %d\n",
idx, wasTracking);
722 if (!GetItemRect(
index, &rc))
763 if (!GetItemRect(
index, &rc))
807 TRACE(
"BeforeCancelPopup\n");
815 TRACE(
"Item click prevented by DisableMouseTrack\n");
822 TRACE(
"OnCommand cancelled because it was tracking submenu.\n");
828 TRACE(
"PopupItem returned S_OK\n");
832 TRACE(
"Executing...\n");
854 GetButton(iIndex, &btn);
876 GetButton(iIndex, &btn);
902 if (dwSelectType != 0xFFFFFFFF)
904 int count = GetButtonCount();
911 else if (dwSelectType ==
VK_END)
914 dwSelectType =
VK_UP;
928 if (dwSelectType ==
VK_UP)
932 else if (dwSelectType ==
VK_DOWN)
939 if (dwSelectType ==
VK_UP)
943 else if (dwSelectType ==
VK_DOWN)
975 if (dwSelectType ==
VK_UP)
979 else if (dwSelectType ==
VK_DOWN)
990 TRACE(
"Setting Hot item to null\n");
1002#if !USE_TBSTYLE_EX_VERTICAL
1008 if (hasSubMenu && (
m_initFlags & SMINIT_VERTICAL))
1022 if (!AddButtons(1, &tbb))
1032#if !USE_TBSTYLE_EX_VERTICAL
1041 if (!AddButtons(1, &tbb))
1050 WCHAR MenuString[128];
1061 if (!AddButtons(1, &tbb))
1069 while (DeleteButton(0))
1093 int index = GetButtonInfo(iItem, &
info);
1137 TRACE(
"PopupItem non-vertical %d %d\n",
index, iItem);
1196 for (
i = 0;
i < ic;
i++)
1208 TRACE(
"Error obtaining info for menu item at pos=%d\n",
i);
1254 delete reinterpret_cast<SMINFO*
>(
tb->tbButton.dwData);
1260 CComPtr<IContextMenu> contextMenu;
1262 reinterpret_cast<WPARAM>(&IID_IContextMenu),
reinterpret_cast<LPARAM>(&contextMenu));
1286 CComPtr<IShellMenu> shellMenu;
1302 m_shellFolder(
NULL),
1342 CComPtr<IEnumIDList> eidl;
1377 L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
1381 TRACE(
"StartMenuAdminTools: %d\n", StartMenuAdminTools);
1382 TRACE(
"bMustHideAdminTools: %d\n", bMustHideAdminTools);
1385 if (bMustHideAdminTools)
1388 szAdminTools,
_countof(szAdminTools));
1406 if (bMustHideAdminTools &&
lstrcmpiW(MenuString, szAdminTools) == 0)
1418 SFGAOF attrs = SFGAO_FOLDER;
1481 ERR(
"ILClone failed!\n");
1496 CComPtr<IContextMenu> contextMenu =
NULL;
1521 CComPtr<IShellMenuCallback> psmc;
1522 CComPtr<IShellMenu> shellMenu;
1536 hr = shellMenu->Initialize(psmc, 0, uId, SMINIT_VERTICAL);
1540 CComPtr<IShellFolder> childFolder;
1545 hr = shellMenu->SetShellFolder(childFolder,
NULL,
NULL, SMSET_TOP);
1557 SFGAOF attrs = SFGAO_FOLDER;
#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
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)
#define FAILED_UNEXPECTEDLY(hr)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
int WINAPI lstrcmpiW(LPCWSTR str1, LPCWSTR str2)
BOOL WINAPI SHGetSpecialFolderPathW(HWND hwndOwner, LPWSTR szPath, int nFolder, BOOL bCreate)
BOOL WINAPI SHRegGetBoolUSValueW(LPCWSTR pszSubKey, LPCWSTR pszValue, BOOL fIgnoreHKCU, BOOL fDefault)
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
GLint GLint GLint GLint GLint GLint y
GLuint GLuint GLsizei count
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)
VOID WINAPI CoTaskMemFree(LPVOID ptr)
HRESULT CompareIDs([in] LPARAM lParam, [in] PCUIDLIST_RELATIVE pidl1, [in] PCUIDLIST_RELATIVE pidl2)
static HANDLE ULONG_PTR dwData
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
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
HRESULT WINAPI SHGetImageList(int iImageList, REFIID riid, void **ppv)
#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)
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
#define SubclassWindow(hwnd, lpfn)
#define HRESULT_FROM_WIN32(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)
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)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
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)
#define IID_PPV_ARG(Itype, ppType)
#define IID_NULL_PPV_ARG(Itype, ppType)