Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a415874f
Commit
a415874f
authored
Mar 05, 2024
by
Zebediah Figura
Committed by
Alexandre Julliard
Mar 07, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Set the drop effect from the context menu.
parent
0c35d5cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
12 deletions
+25
-12
shlview_cmenu.c
dlls/shell32/shlview_cmenu.c
+25
-12
No files found.
dlls/shell32/shlview_cmenu.c
View file @
a415874f
...
...
@@ -327,19 +327,32 @@ static void DoDelete(ContextMenu *This)
}
}
/**************************************************************************
* DoCopyOrCut
*
* copies the currently selected items into the clipboard
*/
static
void
DoCopyOrCut
(
ContextMenu
*
This
,
HWND
hwnd
,
BOOL
cut
)
static
void
do_copy
(
ContextMenu
*
This
,
HWND
hwnd
,
DWORD
drop_effect
)
{
IDataObject
*
dataobject
;
TRACE
(
"(%p)->(wnd=%p, cut=%d)
\n
"
,
This
,
hwnd
,
cut
);
if
(
SUCCEEDED
(
IShellFolder_GetUIObjectOf
(
This
->
parent
,
hwnd
,
This
->
cidl
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
IID_IDataObject
,
0
,
(
void
**
)
&
dataobject
)))
{
FORMATETC
format
;
STGMEDIUM
medium
;
DWORD
*
effect_ptr
;
HRESULT
hr
;
InitFormatEtc
(
format
,
RegisterClipboardFormatW
(
CFSTR_PREFERREDDROPEFFECTW
),
TYMED_HGLOBAL
);
medium
.
tymed
=
TYMED_HGLOBAL
;
medium
.
pUnkForRelease
=
NULL
;
if
(
!
(
medium
.
hGlobal
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
DWORD
))))
{
IDataObject_Release
(
dataobject
);
return
;
}
effect_ptr
=
GlobalLock
(
medium
.
hGlobal
);
*
effect_ptr
=
drop_effect
;
GlobalUnlock
(
medium
.
hGlobal
);
if
(
FAILED
(
hr
=
IDataObject_SetData
(
dataobject
,
&
format
,
&
medium
,
TRUE
)))
ERR
(
"Failed to set data, hr %#lx.
\n
"
,
hr
);
OleSetClipboard
(
dataobject
);
IDataObject_Release
(
dataobject
);
}
...
...
@@ -973,11 +986,11 @@ static HRESULT WINAPI ItemMenu_InvokeCommand(
break
;
case
FCIDM_SHVIEW_COPY
:
TRACE
(
"Verb FCIDM_SHVIEW_COPY
\n
"
);
DoCopyOrCut
(
This
,
lpcmi
->
hwnd
,
FALSE
);
do_copy
(
This
,
lpcmi
->
hwnd
,
DROPEFFECT_COPY
|
DROPEFFECT_LINK
);
break
;
case
FCIDM_SHVIEW_CUT
:
TRACE
(
"Verb FCIDM_SHVIEW_CUT
\n
"
);
DoCopyOrCut
(
This
,
lpcmi
->
hwnd
,
TRU
E
);
do_copy
(
This
,
lpcmi
->
hwnd
,
DROPEFFECT_MOV
E
);
break
;
case
FCIDM_SHVIEW_INSERT
:
do_paste
(
This
,
lpcmi
->
hwnd
);
...
...
@@ -997,9 +1010,9 @@ static HRESULT WINAPI ItemMenu_InvokeCommand(
if
(
strcmp
(
lpcmi
->
lpVerb
,
"delete"
)
==
0
)
DoDelete
(
This
);
else
if
(
strcmp
(
lpcmi
->
lpVerb
,
"copy"
)
==
0
)
DoCopyOrCut
(
This
,
lpcmi
->
hwnd
,
FALSE
);
do_copy
(
This
,
lpcmi
->
hwnd
,
DROPEFFECT_COPY
|
DROPEFFECT_LINK
);
else
if
(
strcmp
(
lpcmi
->
lpVerb
,
"cut"
)
==
0
)
DoCopyOrCut
(
This
,
lpcmi
->
hwnd
,
TRU
E
);
do_copy
(
This
,
lpcmi
->
hwnd
,
DROPEFFECT_MOV
E
);
else
if
(
!
strcmp
(
lpcmi
->
lpVerb
,
"paste"
))
do_paste
(
This
,
lpcmi
->
hwnd
);
else
if
(
strcmp
(
lpcmi
->
lpVerb
,
"properties"
)
==
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment