forked from files-community/Files
-
Notifications
You must be signed in to change notification settings - Fork 0
Drag & drop context menu on right‐click
0x5BFA edited this page Jan 9, 2025
·
6 revisions
- Register your app with
RegisterDragDrop
. - In the
IDropTarget.Drop
method:- Obtain the
IShellFolder
interface for the drop path. - Get the
IDropTarget
interface from this folder. - Forward the
IDataObject
to theDragEnter
andDrop
methods. - The
Drop
method will display the correct context menu.
- Obtain the
void InvokeDragAndDropRMenu(IDropTarget* pDropTarget, IDataObject* pData, DWORD dwKeys, POINTL point, DWORD* pdwEffect)
{
ComPtr<IShellFolder> pShellFolder = default;
ComPtr<IDropTarget> pFolderDropTarget = default;
hr = GetShellFolder(pszPath, pShellFolder.GetAddressOf());
hr = pShellFolder.Get()->CreateViewObject(pShellFolder, &IID_IDropTarget, pFolderDropTarget.GetAddressOf());
hr = pFolderDropTarget.Get()->DragEnter(pFolderDropTarget, pData, PInvoke.MK_RBUTTON, point, pdwEffect);
hr = pFolderDropTarget.Get()->Drop(pFolderDropTarget, pData, PInvoke.MK_RBUTTON, point, pdwEffect);
}
This documentation is not open for everyone. Do not copy.
Controls
- FolderBrowser
- DetailsFolderView
- GridFolderView
- ListFolderView
- TilesFolderView
- ContentFolderView
- ColumnsFolderView
- TreeFolderView
- GalleryFolderView
- HomeFolderView
- RectanglurSelectionVisual
- DataGrid
- SidebarView
- Omnibar
- Toolbar
- FilePreviewPresenter
- ColorTags
- RichTokens
- TerminalView
API
- WindowsStorable
- ArchiveStorable
- HomeStorable
- FtpStorable
- SftpStorable
- WebDAVStorable
Infrastructure
- CommandManager
- MultitaskingManager
- DialogManager
- AppSettings
- OperationServer
Copyright © 2025 0x5BFA. All rights reserved. Do not copy or redistribute modified versions.