The caller of IContextMenu::QueryContextMenu must set these flags when needed, not CDefaultContextMenu.
Notes:
- CMF_CANRENAME is always set by DefView because it always supports rename in its current form. CDefaultContextMenu verifies that SFGAO_CANRENAME is also set on the items. All other callers are expected to not know how to rename unless they also set CMF_CANRENAME. This fixes the bug that the Rename item is present in the TreeView context menu even though the TreeView in ROS Explorer does not handle renaming.
- While DefView now tries to set CMF_EXPLORE correctly, the flag is never actually set because BROWSEUI does not handle FCW_TREE yet.
- This also fixes the bug where the File menu is missing the menu items when there is no selection.
This prevents an issue where clicking on most of the icons on the desktop
that isn't the file explorer causes explorer to throw an exception,
and also prevents another issue where most applications won't launch from the start menu;
at least on MSVC builds running on VirtualBox 5.2.44.
^- I am pretty sure, that this was not always the case. The guilty rev is yet unknown though.
For simplicity and short typing.
JIRA issue: CORE-19469
- Replace "virtual HRESULT STDMETHODCALLTYPE
m" with "STDMETHOD(m)" (m is a method name).
- Replace "virtual t STDMETHODCALLTYPE m" with
"STDMETHOD_(t, m)" (t is a type. m is a method
name).
- Use "override" keyword as possible.
- CDefView should inherit IShellView3 due to
override CreateViewWindow3 method.
- Fix CDefView::CreateViewWindow3 (parameter
prcView is const RECT *, not LPRECT).
Some style-improvements I wanted to apply before a planned backport.
E.g. The biggest source-file CDefView.cpp in [SHELL32] can be shrinked considerably by stripping some outdated
comments from 10 and more years ago, when this class was still non-OOP and named ShellView.
Less excessive line-lengths also here and there.
In case it is not obvious when reviewing: In the beginning of CDevView.cpp in the declaration-part I just
reduced the indentation-level by 4 spaces for a big block.
Some shell classes were touched during 0.4.15-dev'ing for fixes like the 'unkown'-typo in
0.4.15-dev-6323-g 3854a5d8e9 for example
or missing \n were added to dbgprints like in
0.4.15-dev-4492-g 03422451b3
Touched again here, because I want to port those improvements back,
but don't intend to increase the size in older releases.
The commit looks big, but does consist solely of trivialities.
There is no functional change in this commit, aside the logging ofc.
- Adds support for registry controlled menu separators and the documented
values to turn off verbs.
- Adds support for CMF_OPTIMIZEFORINVOKE, CMF_NODEFAULT, CMF_DONOTPICKDEFAULT,
CMF_EXPLORE and CMF_DISABLEDVERBS.
Bugs fixed:
- A verb with "Extended" set in the registry could cause the menu to invoke
the incorrect command! This happened because skipping InsertMenuItemW
caused InvokeCommand to use the wrong index with m_StaticEntries.
- Uses IS_INTRESOURCE instead of HIWORD to check if something is a string
(only matters on 64-bit).
- TryToBrowse leaking a PIDL when calling ILCombine.
Notes:
- This PR introduces the RosGetProcessEffectiveVersion() helper function
discussed in chat.
- Relaxed FAILED_UNEXPECTEDLY to FAILED in two places because IContextMenu
cannot assume that it has a site that leads to IShellBrowser.
* [SHELL32] Fix issue when creating a new file or folder. No chance to rename the displayed name.
The CNewMenu::SelectNewItem method starts with a request to notify the View object about a new item by calling SHChangeNotify.
After creating and obtaining the new PIDL by calling ILFindLastID, the CDefView::SelectItem method is called.
This method fails right from the start when calling LV_FindItemByPidl which returns -1, thus preventing the user from being given the opportunity to change the name displayed by default.
This failure is due to the fact that this object has not yet been added to the CDefView::m_ListView list. This is caused by the asynchronous nature of SHChangeNotify.
Thanks to Giannis Adamopoulos for the big help.
- Add uFlags argument to CDefaultContextMenu::AddShellExtensionsToMenu- CCopyToMenu, CMoveToMenu, and CSendToMenu check the uFlags against (CMF_NOVERBS | CMF_VERBSONLY).
CORE-16544
- Add context menu item "Mo&ve to folder..." and implement the action.
- Implement the "Mo&ve to folder..." menu item of "Edit" menu of Explorer.
CORE-11132
- Add context menu item "Copy to &folder..." and implement the action.
- Implement the "Copy to &folder..." menu item of "Edit" menu of Explorer.
CORE-11132
Shell change notification has been implemented in #2432. But as @yagoulas said, source code structure is in mess. We improved simplicity and human readability of our source code.
- Move wine/changenotify.c code into changenotify.c and shelldesktop/CChangeNotify.cpp.
- Simplify code and rename the identifiers and add many comments. CORE-13950
Add "Command Prompt here" menu item to the Right-click menu of normal folders and drives. Currently, this menu item doesn't work correctly because of the bug of pushd. CORE-12150
- In the exported SHCreateDefaultContextMenu() and
IDataObject_Constructor() functions (called amongst others by
the exported CIDLData_CreateFromIDArray() function).
- In the exported SHCreateShellFolderView() function.
- In CDefView::GetItemObject(), where data was written to *ppvOut before
ppvOut was being checked for NULL.
CDefView: Make GetItemObject return an IContectMenu after setting itself as the site.
CDefViewBckgrndMenu: Make the inner context menu use the same site. Implement handling CMDSTR_VIEWLISTA and CMDSTR_VIEWDETAILSA.
CDefaultContextMenu: CMDSTR_VIEWLISTA and CMDSTR_VIEWDETAILSA shouldn't be handled in this class.
Fixes CORE-14327 and the two buttons that change the view mode