#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 1190 of file COpenWithMenu.cpp.
1191{
1192 TRACE(
"Destroying COpenWithMenu(%p)\n",
this);
1193
1195 {
1198
1199
1202 return;
1203
1204
1206 mii.
cbSize =
sizeof(mii);
1208
1210 {
1212 {
1215 }
1216 }
1217 }
1218
1221}
_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 1274 of file COpenWithMenu.cpp.
1275{
1278 if (!pwszName) return;
1279
1281 mii.
cbSize =
sizeof(mii);
1288
1291 {
1294 }
1295
1298}
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 1246 of file COpenWithMenu.cpp.
1247{
1250
1252 mii.
cbSize =
sizeof(mii);
1257
1259 {
1260 ERR(
"Failed to load string\n");
1261 return;
1262 }
1263
1270
1272}
#define shell32_hInstance
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define IDS_OPEN_WITH_CHOOSE
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
Referenced by QueryContextMenu().
◆ GetCommandString()
Implements IContextMenu.
Definition at line 1429 of file COpenWithMenu.cpp.
1431{
1432 TRACE(
"%p %lu %u %p %p %u\n",
this,
1433 idCmd, uType, pwReserved, pszName,
cchMax );
1434
1438
1440}
HRESULT SHELL_GetCommandStringImpl(SIZE_T CmdId, UINT uFlags, LPSTR Buf, UINT cchBuf, const CMVERBMAP *pMap)
◆ HandleMenuMsg()
◆ IconToBitmap()
Definition at line 1223 of file COpenWithMenu.cpp.
1224{
1228
1234
1240
1242
1244}
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 1453 of file COpenWithMenu.cpp.
1456{
1459
1460 TRACE(
"This %p\n",
this);
1461
1464
1465 CDataObjectHIDA pida(pdtobj);
1467 {
1468 ERR(
"pdtobj->GetData failed with 0x%x\n", pida.hr());
1469 return pida.hr();
1470 }
1471
1473
1476
1478 {
1479 TRACE(
"pidl is not a file\n");
1481 }
1482
1484 if (!pidl)
1485 {
1488 }
1489
1491 {
1492 ERR(
"SHGetPathFromIDListW failed\n");
1494 }
1495
1497
1500 {
1501 TRACE(
"file is a executable or shortcut\n");
1503 }
1504
1506}
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
LPITEMIDLIST WINAPI ILCombine(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
BOOL _ILIsValue(LPCITEMIDLIST pidl)
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
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 1382 of file COpenWithMenu.cpp.
1383{
1386
1388
1390 goto DoChooseApp;
1391
1393 {
1395 {
1396DoChooseApp:
1399
1402 if (pwszExt[0])
1406 }
1407 else
1408 {
1409
1412 mii.
cbSize =
sizeof(mii);
1414
1416 {
1417
1421 }
1422 }
1423 }
1424
1426}
static BOOL Execute(SApp *pApp, LPCWSTR pwszFilePath)
HRESULT SHELL_MapContextMenuVerbToCmdId(LPCMINVOKECOMMANDINFO pICI, const CMVERBMAP *pMap)
@ OAIF_ALLOW_REGISTRATION
#define IS_INTRESOURCE(i)
◆ QueryContextMenu()
Implements IContextMenu.
Definition at line 1306 of file COpenWithMenu.cpp.
1312{
1313 TRACE(
"hMenu %p indexMenu %u idFirst %u idLast %u uFlags %u\n", hMenu, indexMenu, idCmdFirst, idCmdLast,
uFlags);
1314
1316
1320 {
1321 ERR(
"Failed to load string\n");
1323 }
1324
1325
1328
1329
1330 if (DefaultPos != -1)
1331 {
1332
1335
1336
1338 {
1340
1342 {
1346 }
1347
1349 }
1350 }
1351
1352
1355 mii.
cbSize =
sizeof(mii);
1358 {
1362 }
1363 else
1365
1369 if (DefaultPos == -1)
1370 {
1372 indexMenu = 0;
1373 }
1374
1377
1379}
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: