Commit graph

32 commits

Author SHA1 Message Date
Carl J. Bialorucki 78dc504e72
[SHELL32] Initialize MenuItemInfoW struct in AddStaticContextMenusToMenu (#6737)
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.
2024-04-14 00:12:35 +02:00
Whindmar Saksit 373816c729
[SHELL32] Support IDropTarget handler in IContextMenu static verbs (#5860)
This adds support for the `DropHandler` subkey in static verbs. `IDropTarget` is called when the verb is invoked. The advantage of this is that no library needs to be loaded until the verb is actually invoked unlike `IContextMenu` shell extensions that have to be loaded during menu creation.

This method is preferred for verb implementations that must work on Windows XP, see
https://learn.microsoft.com/en-us/previous-versions/windows/desktop/legacy/dd940354%28v%3Dvs.85%29?redirectedfrom=MSDN#description
2024-03-24 18:23:07 +01:00
Katayama Hirofumi MZ 49b2b1dab1
[SHELL32] Use STDMETHOD macro and keyword override (#6570)
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).
2024-03-05 08:43:39 +09:00
Joachim Henze 6f91b6c0fe [SHELL32] Tweak formatting and logging
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.
2024-02-20 02:08:56 +01:00
Serge Gautherie 0ba94c83b5
[SHELL32] AddStaticContextMenusToMenu(): Fix 3 MSVC 'warning C4805' (#6177)
- Use 'bool' type.
- Do not abuse '|=' operator.

Addendum to commit 7fb91d98f
2023-12-17 22:20:06 +01:00
Whindmar Saksit 7fb91d98f9
[SHELL32] Add support for more registry verb flags and CMF flags (#5785)
- 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.
2023-11-13 16:21:13 +01:00
Jose Carlos Jesus b8c4d589b1
[SHELL32] Give opportunity to rename file/folder on its creation (#5139)
* [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.
2023-03-14 22:27:14 +01:00
Katayama Hirofumi MZ 8e036fe74d
[SHELL32] Improve StartButton context menu (#5008)
- Add uFlags argument to CDefaultContextMenu::AddShellExtensionsToMenu- CCopyToMenu, CMoveToMenu, and CSendToMenu check the uFlags against (CMF_NOVERBS | CMF_VERBSONLY).
CORE-16544
2023-01-29 22:40:40 +09:00
Mark Jansen 0452d3415a
[SHELL32] Fix 'Paste' command in context menu not working
Bug found by Rosen Iliev
2022-10-19 19:38:33 +02:00
Mark Jansen 5bd86b8487
[SHELL32] Fix menu item handling
This restores the 'properties' functionality on the desktop
Bug found by Hervé Poussineau
2022-10-19 19:37:41 +02:00
Mark Jansen 9efa7cc498
[SHELL32] Fix CDefaultContextMenu DFM_MERGECONTEXTMENU handling 2022-10-14 21:04:19 +02:00
Mark Jansen 6a1f287820
[SHELL32] Show file / drive properties at the position where the mouse was.
CORE-18386
2022-10-14 21:02:33 +02:00
Doug Lyons cc0e2a3672
[SHELL32] Fix Shift-Delete to Permanently Delete Files and Folders (#4004)
CORE-17802
2022-05-05 17:30:06 +02:00
Serge Gautherie 03422451b3 [REACTOS] Add '\n' to debug logs
on TRACE, WARN, FIXME and ERR calls.

Plus a few nit picks.
2022-05-04 03:28:38 +03:00
Mark Jansen 6a68717c58
[SHELL32] CDefaultContextMenu: Provide a fallback property sheet
CORE-17691
2022-02-22 19:40:09 +01:00
Mark Jansen db39a50c73
Simplify CDefaultContextMenu by using CAtlList (#3405) 2021-12-17 13:01:03 +09:00
Hermès Bélusca-Maïto 9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Katayama Hirofumi MZ 8fa3c147b6
[BROWSEUI][SHELL32] Implement MoveTo/CopyTo buttons (#3128)
Implement the actions of the MoveTo/CopyTo/Delete buttons.
CORE-11132
2020-09-07 09:42:43 +09:00
Katayama Hirofumi MZ 46ff964e22
[SHELL32] Implement Move To Folder (#3056)
- 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
2020-08-18 05:30:54 +09:00
Katayama Hirofumi MZ 85fdcdf2cc
[SHELL32] Implement Copy To Folder (retrial) (#3044)
- 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
2020-08-16 08:04:07 +09:00
Katayama Hirofumi MZ 2727245c86
[SHELL32] Shell notify rework for simplicity and readability (#2539)
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
2020-04-13 10:36:24 +09:00
Katayama Hirofumi MZ 90c63d12a1
[SHELL32][BOOTDATA] Implement Command Prompt here (#2029)
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
2019-11-14 23:25:21 +09:00
Mark Jansen 1f362c1a5a
[SHELL32] CDefaultContextMenu: Don't render a medium just to query if it is present 2019-10-20 17:10:12 +02:00
Mark Jansen e45beb55f8
[SHELL32] CDefaultContextMenu: Always add the wanted operation to the IDataObject 2019-10-20 17:10:12 +02:00
Mark Jansen 5d7ae44059
[SHELL32] Demote an ERR to WARN 2019-10-19 18:41:52 +02:00
Thomas Faber b90c24d640
[SHELL] IPersistFolder2::GetCurFolder takes a PIDLIST_ABSOLUTE*. CORE-16385 2019-09-22 16:19:09 +02:00
Hermès Bélusca-Maïto ae2a85d003
[SHELL32] Fix some NULL-pointers validation.
- 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.
2019-06-08 19:43:02 +02:00
Mark Jansen 0d07967a27
[SHELL32] Initial partial IShellFolderViewCB implementation. 2018-04-07 15:29:53 +02:00
Giannis Adamopoulos c361e475b4 [SHELL32] CDefaultContextMenu: Implement GetCommandString 2018-02-20 13:05:59 +02:00
Giannis Adamopoulos 67f99833cd [SHELL32] CNewMenu: Don't use CWM_GETISHELLBROWSER.
CDefaultContextMenu: Set the site for context menu extensions
CNewMenu: Get SID_IFolderView service of the site to get the IShellView
2018-02-15 00:58:22 +02:00
Giannis Adamopoulos b97886ea9f [SHELL32] Fix the toolbar buttons in the file open dialog
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
2018-02-15 00:23:18 +02:00
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Renamed from reactos/dll/win32/shell32/CDefaultContextMenu.cpp (Browse further)