Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-fonts
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
Aleksandr Isakov
wine-fonts
Commits
4d94d5ef
Commit
4d94d5ef
authored
Apr 02, 2016
by
Michael Müller
Committed by
Vitaly Lipatov
Jul 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Implement insert/paste for item context menus.
parent
623694a6
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
5 deletions
+41
-5
shell32.rc
dlls/shell32/shell32.rc
+1
-0
shlview_cmenu.c
dlls/shell32/shlview_cmenu.c
+40
-5
No files found.
dlls/shell32/shell32.rc
View file @
4d94d5ef
...
...
@@ -99,6 +99,7 @@ BEGIN
MENUITEM SEPARATOR
MENUITEM "C&ut", FCIDM_SHVIEW_CUT
MENUITEM "&Copy", FCIDM_SHVIEW_COPY
MENUITEM "&Paste", FCIDM_SHVIEW_INSERT
MENUITEM SEPARATOR
MENUITEM "Create &Link", FCIDM_SHVIEW_CREATELINK
MENUITEM "&Delete", FCIDM_SHVIEW_DELETE
...
...
dlls/shell32/shlview_cmenu.c
View file @
4d94d5ef
...
...
@@ -184,6 +184,8 @@ typedef struct
BOOL
desktop
;
}
ContextMenu
;
static
HRESULT
DoPaste
(
ContextMenu
*
This
);
static
inline
ContextMenu
*
impl_from_IContextMenu3
(
IContextMenu3
*
iface
)
{
return
CONTAINING_RECORD
(
iface
,
ContextMenu
,
IContextMenu3_iface
);
...
...
@@ -293,6 +295,30 @@ static UINT max_menu_id(HMENU hmenu, UINT offset, UINT last)
return
max_id
;
}
static
BOOL
CheckClipboard
(
void
)
{
IDataObject
*
pda
;
BOOL
ret
=
FALSE
;
if
(
SUCCEEDED
(
OleGetClipboard
(
&
pda
)))
{
STGMEDIUM
medium
;
FORMATETC
formatetc
;
/* Set the FORMATETC structure*/
InitFormatEtc
(
formatetc
,
RegisterClipboardFormatW
(
CFSTR_SHELLIDLISTW
),
TYMED_HGLOBAL
);
/* Get the pidls from IDataObject */
if
(
SUCCEEDED
(
IDataObject_GetData
(
pda
,
&
formatetc
,
&
medium
)))
{
ReleaseStgMedium
(
&
medium
);
ret
=
TRUE
;
}
IDataObject_Release
(
pda
);
}
return
ret
;
}
static
HRESULT
WINAPI
ItemMenu_QueryContextMenu
(
IContextMenu3
*
iface
,
HMENU
hmenu
,
...
...
@@ -303,6 +329,7 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu(
{
ContextMenu
*
This
=
impl_from_IContextMenu3
(
iface
);
INT
uIDMax
;
DWORD
attr
=
SFGAO_CANRENAME
;
TRACE
(
"(%p)->(%p %d 0x%x 0x%x 0x%x )
\n
"
,
This
,
hmenu
,
indexMenu
,
idCmdFirst
,
idCmdLast
,
uFlags
);
...
...
@@ -340,6 +367,9 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu(
SetMenuDefaultItem
(
hmenu
,
0
,
MF_BYPOSITION
);
if
(
This
->
apidl
&&
This
->
cidl
==
1
)
IShellFolder_GetAttributesOf
(
This
->
parent
,
1
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
attr
);
if
(
uFlags
&
~
CMF_CANRENAME
)
RemoveMenu
(
hmenu
,
FCIDM_SHVIEW_RENAME
-
FCIDM_BASE
+
idCmdFirst
,
MF_BYCOMMAND
);
else
...
...
@@ -350,16 +380,14 @@ static HRESULT WINAPI ItemMenu_QueryContextMenu(
if
(
!
This
->
apidl
||
This
->
cidl
>
1
)
enable
|=
MFS_DISABLED
;
else
{
DWORD
attr
=
SFGAO_CANRENAME
;
IShellFolder_GetAttributesOf
(
This
->
parent
,
1
,
(
LPCITEMIDLIST
*
)
This
->
apidl
,
&
attr
);
enable
|=
(
attr
&
SFGAO_CANRENAME
)
?
MFS_ENABLED
:
MFS_DISABLED
;
}
EnableMenuItem
(
hmenu
,
FCIDM_SHVIEW_RENAME
-
FCIDM_BASE
+
idCmdFirst
,
enable
);
}
if
((
attr
&
(
SFGAO_FILESYSTEM
|
SFGAO_FOLDER
))
!=
(
SFGAO_FILESYSTEM
|
SFGAO_FOLDER
)
||
!
CheckClipboard
())
RemoveMenu
(
hmenu
,
FCIDM_SHVIEW_INSERT
-
FCIDM_BASE
+
idCmdFirst
,
MF_BYCOMMAND
);
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
uIDMax
-
idCmdFirst
);
}
return
MAKE_HRESULT
(
SEVERITY_SUCCESS
,
0
,
0
);
...
...
@@ -1182,6 +1210,10 @@ static HRESULT WINAPI ItemMenu_InvokeCommand(
TRACE
(
"Verb FCIDM_SHVIEW_CUT
\n
"
);
DoCopyOrCut
(
This
,
lpcmi
->
hwnd
,
TRUE
);
break
;
case
FCIDM_SHVIEW_INSERT
:
TRACE
(
"Verb FCIDM_SHVIEW_INSERT
\n
"
);
DoPaste
(
This
);
break
;
case
FCIDM_SHVIEW_PROPERTIES
:
TRACE
(
"Verb FCIDM_SHVIEW_PROPERTIES
\n
"
);
DoOpenProperties
(
This
,
lpcmi
->
hwnd
);
...
...
@@ -1242,6 +1274,9 @@ static HRESULT WINAPI ItemMenu_GetCommandString(IContextMenu3 *iface, UINT_PTR c
case
FCIDM_SHVIEW_COPY
:
cmdW
=
L"copy"
;
break
;
case
FCIDM_SHVIEW_INSERT
:
cmdW
=
L"paste"
;
break
;
case
FCIDM_SHVIEW_CREATELINK
:
cmdW
=
L"link"
;
break
;
...
...
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