mirror of
https://github.com/reactos/reactos.git
synced 2025-04-04 04:26:32 +00:00
[SHELL32] No new menu and working properties in Drives and NetHood background menu (#7430)
- No "New" menu in My Computer background menu. - Add "Properties" in NetHood background menu.
This commit is contained in:
parent
92996dac21
commit
9cca5bf4b0
2 changed files with 31 additions and 17 deletions
|
@ -915,20 +915,7 @@ HRESULT WINAPI CDrivesFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVO
|
|||
}
|
||||
else if (IsEqualIID(riid, IID_IContextMenu))
|
||||
{
|
||||
HKEY hKeys[16];
|
||||
UINT cKeys = 0;
|
||||
AddClassKeyToArray(L"Directory\\Background", hKeys, &cKeys);
|
||||
|
||||
DEFCONTEXTMENU dcm;
|
||||
dcm.hwnd = hwndOwner;
|
||||
dcm.pcmcb = this;
|
||||
dcm.pidlFolder = pidlRoot;
|
||||
dcm.psf = this;
|
||||
dcm.cidl = 0;
|
||||
dcm.apidl = NULL;
|
||||
dcm.cKeys = cKeys;
|
||||
dcm.aKeys = hKeys;
|
||||
dcm.punkAssociationInfo = NULL;
|
||||
DEFCONTEXTMENU dcm = { hwndOwner, this, pidlRoot, this };
|
||||
hr = SHCreateDefaultContextMenu(&dcm, riid, ppvOut);
|
||||
}
|
||||
else if (IsEqualIID(riid, IID_IShellView))
|
||||
|
@ -1364,7 +1351,7 @@ HRESULT WINAPI CDrivesFolder::CallBack(IShellFolder *psf, HWND hwndOwner, IDataO
|
|||
// "System" properties
|
||||
return SHELL_ExecuteControlPanelCPL(hwndOwner, L"sysdm.cpl") ? S_OK : E_FAIL;
|
||||
}
|
||||
else if (uMsg == DFM_MERGECONTEXTMENU)
|
||||
else if (uMsg == DFM_MERGECONTEXTMENU) // TODO: DFM_MERGECONTEXTMENU_BOTTOM
|
||||
{
|
||||
QCMINFO *pqcminfo = (QCMINFO *)lParam;
|
||||
HMENU hpopup = CreatePopupMenu();
|
||||
|
|
|
@ -207,6 +207,33 @@ BOOL CNetFolderEnum::CreateMyCompEnumList(DWORD dwFlags)
|
|||
return bRet;
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* CNetFolder background context menu
|
||||
*/
|
||||
static HRESULT CALLBACK CNetFolderBackgroundMenuCB(IShellFolder *psf, HWND hwnd, IDataObject *pdtobj,
|
||||
UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
enum { IDC_PROPERTIES };
|
||||
if (uMsg == DFM_INVOKECOMMAND && wParam == IDC_PROPERTIES)
|
||||
{
|
||||
return SHELL_ExecuteControlPanelCPL(hwnd, L"ncpa.cpl") ? S_OK : E_FAIL;
|
||||
}
|
||||
else if (uMsg == DFM_MERGECONTEXTMENU) // TODO: DFM_MERGECONTEXTMENU_BOTTOM
|
||||
{
|
||||
QCMINFO *pqcminfo = (QCMINFO*)lParam;
|
||||
HMENU hpopup = CreatePopupMenu();
|
||||
_InsertMenuItemW(hpopup, 0, TRUE, IDC_PROPERTIES, MFT_STRING, MAKEINTRESOURCEW(IDS_PROPERTIES), MFS_ENABLED);
|
||||
pqcminfo->idCmdFirst = Shell_MergeMenus(pqcminfo->hmenu, hpopup, pqcminfo->indexMenu, pqcminfo->idCmdFirst, pqcminfo->idCmdLast, MM_ADDSEPARATOR);
|
||||
DestroyMenu(hpopup);
|
||||
return S_OK;
|
||||
}
|
||||
return SHELL32_DefaultContextMenuCallBack(psf, pdtobj, uMsg);
|
||||
}
|
||||
|
||||
/**************************************************************************
|
||||
* CNetFolder
|
||||
*/
|
||||
|
||||
CNetFolder::CNetFolder()
|
||||
{
|
||||
pidlRoot = NULL;
|
||||
|
@ -330,8 +357,8 @@ HRESULT WINAPI CNetFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID
|
|||
}
|
||||
else if (IsEqualIID(riid, IID_IContextMenu))
|
||||
{
|
||||
WARN("IContextMenu not implemented\n");
|
||||
hr = E_NOTIMPL;
|
||||
hr = CDefFolderMenu_Create2(pidlRoot, hwndOwner, 0, NULL, this, CNetFolderBackgroundMenuCB,
|
||||
0, NULL, (IContextMenu**)ppvOut);
|
||||
}
|
||||
else if (IsEqualIID(riid, IID_IShellView))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue