CDefaultContextMenu.cpp (724b20d4) CDefaultContextMenu.cpp (d5f6b8c5)
1/*
2 * PROJECT: shell32
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/shell32/shv_item_new.c
5 * PURPOSE: provides default context menu implementation
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
7 */
8

--- 862 unchanged lines hidden (view full) ---

871 {
872 /* Get the attributes of the items */
873 SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
874 hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg);
875 if (FAILED_UNEXPECTEDLY(hr))
876 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, cIds);
877
878 /* Add the default part of the menu */
1/*
2 * PROJECT: shell32
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: dll/win32/shell32/shv_item_new.c
5 * PURPOSE: provides default context menu implementation
6 * PROGRAMMERS: Johannes Anderwald (johannes.anderwald@reactos.org)
7 */
8

--- 862 unchanged lines hidden (view full) ---

871 {
872 /* Get the attributes of the items */
873 SFGAOF rfg = SFGAO_BROWSABLE | SFGAO_CANCOPY | SFGAO_CANLINK | SFGAO_CANMOVE | SFGAO_CANDELETE | SFGAO_CANRENAME | SFGAO_HASPROPSHEET | SFGAO_FILESYSTEM | SFGAO_FOLDER;
874 hr = m_psf->GetAttributesOf(m_cidl, m_apidl, &rfg);
875 if (FAILED_UNEXPECTEDLY(hr))
876 return MAKE_HRESULT(SEVERITY_SUCCESS, 0, cIds);
877
878 /* Add the default part of the menu */
879 HMENU hmenuDefault = LoadMenu(_AtlBaseModule.GetResourceInstance(), L"MENU_SHV_FILE");
879 HMENU hmenuDefault = LoadMenuW(_AtlBaseModule.GetResourceInstance(), L"MENU_SHV_FILE");
880
881 /* Remove uneeded entries */
882 if (!(rfg & SFGAO_CANMOVE))
883 DeleteMenu(hmenuDefault, IDM_CUT, MF_BYCOMMAND);
884 if (!(rfg & SFGAO_CANCOPY))
885 DeleteMenu(hmenuDefault, IDM_COPY, MF_BYCOMMAND);
886 if (!((rfg & SFGAO_FILESYSTEM) && HasClipboardData()))
887 DeleteMenu(hmenuDefault, IDM_INSERT, MF_BYCOMMAND);

--- 367 unchanged lines hidden (view full) ---

1255 return 0;
1256
1257 /* See if we are in Explore or Browse mode. If the browser's tree is present, we are in Explore mode.*/
1258 if (SUCCEEDED(psb->GetControlWindow(FCW_TREE, &hwndTree)) && hwndTree)
1259 FlagsName = L"ExplorerFlags";
1260 else
1261 FlagsName = L"BrowserFlags";
1262
880
881 /* Remove uneeded entries */
882 if (!(rfg & SFGAO_CANMOVE))
883 DeleteMenu(hmenuDefault, IDM_CUT, MF_BYCOMMAND);
884 if (!(rfg & SFGAO_CANCOPY))
885 DeleteMenu(hmenuDefault, IDM_COPY, MF_BYCOMMAND);
886 if (!((rfg & SFGAO_FILESYSTEM) && HasClipboardData()))
887 DeleteMenu(hmenuDefault, IDM_INSERT, MF_BYCOMMAND);

--- 367 unchanged lines hidden (view full) ---

1255 return 0;
1256
1257 /* See if we are in Explore or Browse mode. If the browser's tree is present, we are in Explore mode.*/
1258 if (SUCCEEDED(psb->GetControlWindow(FCW_TREE, &hwndTree)) && hwndTree)
1259 FlagsName = L"ExplorerFlags";
1260 else
1261 FlagsName = L"BrowserFlags";
1262
1263 CComPtr<ICommDlgBrowser> pcdb;
1264 if (SUCCEEDED(psb->QueryInterface(IID_PPV_ARG(ICommDlgBrowser, &pcdb))))
1265 {
1266 if (LOBYTE(GetVersion()) < 6 || FlagsName[0] == 'E')
1267 return 0; // Don't browse in-place
1268 }
1269
1263 /* Try to get the flag from the verb */
1264 hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", pEntry->Verb.GetString());
1265 if (FAILED_UNEXPECTEDLY(hr))
1266 return 0;
1267
1268 cbVerb = sizeof(wFlags);
1269 if (RegGetValueW(pEntry->hkClass, wszKey, FlagsName, RRF_RT_REG_DWORD, NULL, &wFlags, &cbVerb) == ERROR_SUCCESS)
1270 {

--- 549 unchanged lines hidden ---
1270 /* Try to get the flag from the verb */
1271 hr = StringCbPrintfW(wszKey, sizeof(wszKey), L"shell\\%s", pEntry->Verb.GetString());
1272 if (FAILED_UNEXPECTEDLY(hr))
1273 return 0;
1274
1275 cbVerb = sizeof(wFlags);
1276 if (RegGetValueW(pEntry->hkClass, wszKey, FlagsName, RRF_RT_REG_DWORD, NULL, &wFlags, &cbVerb) == ERROR_SUCCESS)
1277 {

--- 549 unchanged lines hidden ---