#include <COpenWithMenu.h>
|
| | COpenWithMenu () |
| |
| | ~COpenWithMenu () |
| |
| STDMETHOD() | QueryContextMenu (HMENU hMenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags) override |
| |
| STDMETHOD() | InvokeCommand (LPCMINVOKECOMMANDINFO lpcmi) override |
| |
| STDMETHOD() | GetCommandString (UINT_PTR idCommand, UINT uFlags, UINT *lpReserved, LPSTR lpszName, UINT uMaxNameLen) override |
| |
| STDMETHOD() | HandleMenuMsg (UINT uMsg, WPARAM wParam, LPARAM lParam) override |
| |
| STDMETHOD() | Initialize (PCIDLIST_ABSOLUTE pidlFolder, IDataObject *pdtobj, HKEY hkeyProgID) override |
| |
| | ~CComObjectRootEx () |
| |
| ULONG | InternalAddRef () |
| |
| ULONG | InternalRelease () |
| |
| void | Lock () |
| |
| void | Unlock () |
| |
| HRESULT | _AtlInitialConstruct () |
| |
| | CComObjectRootBase () |
| |
| | ~CComObjectRootBase () |
| |
| void | SetVoid (void *) |
| |
| HRESULT | _AtlFinalConstruct () |
| |
| HRESULT | FinalConstruct () |
| |
| void | InternalFinalConstructAddRef () |
| |
| void | InternalFinalConstructRelease () |
| |
| void | FinalRelease () |
| |
| HRESULT | HandleMenuMsg ([in] UINT uMsg, [in] WPARAM wParam, [in] LPARAM lParam) |
| |
| HRESULT | QueryContextMenu ([in] HMENU hmenu, [in] UINT indexMenu, [in] UINT idCmdFirst, [in] UINT idCmdLast, [in] UINT uFlags) |
| |
| HRESULT | InvokeCommand ([in] LPCMINVOKECOMMANDINFO lpici) |
| |
| HRESULT | GetCommandString ([in] UINT_PTR idCmd, [in] UINT uType, [out] UINT *pwReserved, [out, size_is(cchMax)] LPSTR pszName, [in] UINT cchMax) |
| |
| HRESULT | QueryInterface ([in] REFIID riid, [out, iid_is(riid)] void **ppvObject) |
| |
| ULONG | AddRef () |
| |
| ULONG | Release () |
| |
| HRESULT | Initialize ([in] PCIDLIST_ABSOLUTE pidlFolder, [in] IDataObject *pdtobj, [in] HKEY hkeyProgID) |
| |
Definition at line 28 of file COpenWithMenu.h.
◆ COpenWithMenu()
| COpenWithMenu::COpenWithMenu |
( |
| ) |
|
◆ ~COpenWithMenu()
| COpenWithMenu::~COpenWithMenu |
( |
| ) |
|
Definition at line 1267 of file COpenWithMenu.cpp.
1268{
1269 TRACE(
"Destroying COpenWithMenu(%p)\n",
this);
1270
1272 {
1275
1276
1279 return;
1280
1281
1283 mii.
cbSize =
sizeof(mii);
1285
1287 {
1289 {
1292 }
1293 }
1294 }
1295
1298}
_In_ WDFCOLLECTION _In_ ULONG Index
int WINAPI GetMenuItemCount(_In_opt_ HMENU)
BOOL WINAPI GetMenuItemInfoW(_In_ HMENU, _In_ UINT, _In_ BOOL, _Inout_ LPMENUITEMINFOW)
◆ AddApp()
Definition at line 1351 of file COpenWithMenu.cpp.
1352{
1355 if (!pwszName) return;
1356
1358 mii.
cbSize =
sizeof(mii);
1365
1368 {
1371 }
1372
1375}
static LPCWSTR GetName(SApp *pApp)
static HICON GetIcon(SApp *pApp)
BOOL WINAPI InsertMenuItemW(_In_ HMENU, _In_ UINT, _In_ BOOL, _In_ LPCMENUITEMINFOW)
Referenced by QueryContextMenu().
◆ AddChooseProgramItem()
| VOID COpenWithMenu::AddChooseProgramItem |
( |
| ) |
|
|
private |
Definition at line 1323 of file COpenWithMenu.cpp.
1324{
1327
1329 mii.
cbSize =
sizeof(mii);
1334
1336 {
1337 ERR(
"Failed to load string\n");
1338 return;
1339 }
1340
1347
1349}
#define shell32_hInstance
INT WINAPI DECLSPEC_HOTPATCH LoadStringW(HINSTANCE instance, UINT resource_id, LPWSTR buffer, INT buflen)
_ACRTIMP size_t __cdecl wcslen(const wchar_t *)
#define IDS_OPEN_WITH_CHOOSE
Referenced by QueryContextMenu().
◆ GetCommandString()
Implements IContextMenu.
Definition at line 1498 of file COpenWithMenu.cpp.
1500{
1501 TRACE(
"%p %lu %u %p %p %u\n",
this,
1502 idCmd, uType, pwReserved, pszName,
cchMax );
1503
1507
1509}
HRESULT SHELL_GetCommandStringImpl(SIZE_T CmdId, UINT uFlags, LPSTR Buf, UINT cchBuf, const CMVERBMAP *pMap)
◆ HandleMenuMsg()
◆ IconToBitmap()
Definition at line 1300 of file COpenWithMenu.cpp.
1301{
1305
1311
1317
1319
1321}
DWORD WINAPI GetLastError(void)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI DeleteDC(_In_ HDC)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI DrawIconEx(_In_ HDC, _In_ int, _In_ int, _In_ HICON, _In_ int, _In_ int, _In_ UINT, _In_opt_ HBRUSH, _In_ UINT)
HDC WINAPI GetDC(_In_opt_ HWND)
int WINAPI GetSystemMetrics(_In_ int)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
Referenced by AddApp().
◆ Initialize()
Implements IShellExtInit.
Definition at line 1522 of file COpenWithMenu.cpp.
1525{
1528
1529 TRACE(
"This %p\n",
this);
1530
1533
1534 CDataObjectHIDA pida(pdtobj);
1536 {
1537 ERR(
"pdtobj->GetData failed with 0x%x\n", pida.hr());
1538 return pida.hr();
1539 }
1540
1542
1545
1547 {
1548 TRACE(
"pidl is not a file\n");
1550 }
1551
1553 if (!pidl)
1554 {
1557 }
1558
1560 {
1561 ERR(
"SHGetPathFromIDListW failed\n");
1563 }
1564
1566
1569 {
1570 TRACE(
"file is a executable or shortcut\n");
1572 }
1573
1575}
LPWSTR WINAPI PathFindExtensionW(const WCHAR *path)
_ACRTIMP int __cdecl _wcsicmp(const wchar_t *, const wchar_t *)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
BOOL _ILIsValue(LPCITEMIDLIST pidl)
static PCUIDLIST_RELATIVE HIDA_GetPIDLItem(CIDA const *pida, SIZE_T i)
static PCUIDLIST_ABSOLUTE HIDA_GetPIDLFolder(CIDA const *pida)
const ITEMIDLIST UNALIGNED * LPCITEMIDLIST
◆ InvokeCommand()
Implements IContextMenu.
Definition at line 1459 of file COpenWithMenu.cpp.
1460{
1463
1465
1467 goto DoChooseApp;
1468
1470 {
1472 {
1473DoChooseApp:
1475 }
1476 else
1477 {
1478
1481 mii.
cbSize =
sizeof(mii);
1483
1485 {
1486
1490 }
1491 }
1492 }
1493
1495}
static BOOL Execute(SApp *pApp, LPCWSTR pwszFilePath)
#define IS_INTRESOURCE(x)
HRESULT SHELL_MapContextMenuVerbToCmdId(LPCMINVOKECOMMANDINFO pICI, const CMVERBMAP *pMap)
◆ QueryContextMenu()
Implements IContextMenu.
Definition at line 1383 of file COpenWithMenu.cpp.
1389{
1390 TRACE(
"hMenu %p indexMenu %u idFirst %u idLast %u uFlags %u\n", hMenu, indexMenu, idCmdFirst, idCmdLast,
uFlags);
1391
1393
1397 {
1398 ERR(
"Failed to load string\n");
1400 }
1401
1402
1405
1406
1407 if (DefaultPos != -1)
1408 {
1409
1412
1413
1415 {
1417
1419 {
1423 }
1424
1426 }
1427 }
1428
1429
1432 mii.
cbSize =
sizeof(mii);
1435 {
1439 }
1440 else
1442
1446 if (DefaultPos == -1)
1447 {
1449 indexMenu = 0;
1450 }
1451
1454
1456}
BOOL LoadRecommended(LPCWSTR pwszFilePath)
UINT GetRecommendedCount()
#define MAKE_HRESULT(sev, fac, code)
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
HMENU WINAPI CreatePopupMenu(void)
UINT WINAPI GetMenuDefaultItem(_In_ HMENU hMenu, _In_ UINT fByPos, _In_ UINT gmdiFlags)
◆ m_hSubMenu
| HMENU COpenWithMenu::m_hSubMenu |
|
private |
◆ m_idCmdFirst
| UINT COpenWithMenu::m_idCmdFirst |
|
private |
◆ m_idCmdLast
| UINT COpenWithMenu::m_idCmdLast |
|
private |
◆ m_pAppList
◆ m_wszPath
The documentation for this class was generated from the following files: