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
05c0cd00
Commit
05c0cd00
authored
May 04, 2005
by
Martin Fuchs
Committed by
Alexandre Julliard
May 04, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement owner drawn context menus.
parent
ed2a6e4a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
74 additions
and
1 deletion
+74
-1
winefile.c
programs/winefile/winefile.c
+74
-1
No files found.
programs/winefile/winefile.c
View file @
05c0cd00
...
...
@@ -3367,6 +3367,48 @@ static BOOL pane_command(Pane* pane, UINT cmd)
}
static
IContextMenu2
*
s_pctxmenu2
=
NULL
;
static
IContextMenu3
*
s_pctxmenu3
=
NULL
;
static
void
CtxMenu_reset
()
{
s_pctxmenu2
=
NULL
;
s_pctxmenu3
=
NULL
;
}
IContextMenu
*
CtxMenu_query_interfaces
(
IContextMenu
*
pcm1
)
{
IContextMenu
*
pcm
=
NULL
;
CtxMenu_reset
();
if
((
*
pcm1
->
lpVtbl
->
QueryInterface
)(
pcm1
,
&
IID_IContextMenu3
,
(
void
**
)
&
pcm
)
==
NOERROR
)
s_pctxmenu3
=
(
LPCONTEXTMENU3
)
pcm
;
else
if
((
*
pcm1
->
lpVtbl
->
QueryInterface
)(
pcm1
,
&
IID_IContextMenu2
,
(
void
**
)
&
pcm
)
==
NOERROR
)
s_pctxmenu2
=
(
LPCONTEXTMENU2
)
pcm
;
if
(
pcm
)
{
(
*
pcm1
->
lpVtbl
->
Release
)(
pcm1
);
return
pcm
;
}
else
return
pcm1
;
}
static
BOOL
CtxMenu_HandleMenuMsg
(
UINT
nmsg
,
WPARAM
wparam
,
LPARAM
lparam
)
{
if
(
s_pctxmenu3
)
{
if
(
SUCCEEDED
((
*
s_pctxmenu3
->
lpVtbl
->
HandleMenuMsg
)(
s_pctxmenu3
,
nmsg
,
wparam
,
lparam
)))
return
TRUE
;
}
if
(
s_pctxmenu2
)
if
(
SUCCEEDED
((
*
s_pctxmenu2
->
lpVtbl
->
HandleMenuMsg
)(
s_pctxmenu2
,
nmsg
,
wparam
,
lparam
)))
return
TRUE
;
return
FALSE
;
}
static
HRESULT
ShellFolderContextMenu
(
IShellFolder
*
shell_folder
,
HWND
hwndParent
,
int
cidl
,
LPCITEMIDLIST
*
apidl
,
int
x
,
int
y
)
{
IContextMenu
*
pcm
;
...
...
@@ -3377,12 +3419,16 @@ static HRESULT ShellFolderContextMenu(IShellFolder* shell_folder, HWND hwndParen
if
(
SUCCEEDED
(
hr
))
{
HMENU
hmenu
=
CreatePopupMenu
();
pcm
=
CtxMenu_query_interfaces
(
pcm
);
if
(
hmenu
)
{
hr
=
(
*
pcm
->
lpVtbl
->
QueryContextMenu
)(
pcm
,
hmenu
,
0
,
FCIDM_SHVIEWFIRST
,
FCIDM_SHVIEWLAST
,
CMF_NORMAL
);
if
(
SUCCEEDED
(
hr
))
{
UINT
idCmd
=
TrackPopupMenu
(
hmenu
,
TPM_LEFTALIGN
|
TPM_RETURNCMD
|
TPM_RIGHTBUTTON
,
x
,
y
,
0
,
hwndParent
,
NULL
);
CtxMenu_reset
();
if
(
idCmd
)
{
CMINVOKECOMMANDINFO
cmi
;
...
...
@@ -3422,8 +3468,10 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
if
(
dis
->
CtlID
==
IDW_TREE_LEFT
)
draw_item
(
&
child
->
left
,
dis
,
entry
,
-
1
);
else
else
if
(
dis
->
CtlID
==
IDW_TREE_RIGHT
)
draw_item
(
&
child
->
right
,
dis
,
entry
,
-
1
);
else
goto
draw_menu_item
;
return
TRUE
;}
...
...
@@ -3703,6 +3751,31 @@ LRESULT CALLBACK ChildWndProc(HWND hwnd, UINT nmsg, WPARAM wparam, LPARAM lparam
break
;}
#endif
case
WM_MEASUREITEM
:
draw_menu_item:
if
(
!
wparam
)
/* Is the message menu-related? */
if
(
CtxMenu_HandleMenuMsg
(
nmsg
,
wparam
,
lparam
))
return
TRUE
;
break
;
case
WM_INITMENUPOPUP
:
if
(
CtxMenu_HandleMenuMsg
(
nmsg
,
wparam
,
lparam
))
return
0
;
break
;
case
WM_MENUCHAR
:
/* only supported by IContextMenu3 */
if
(
s_pctxmenu3
)
{
LRESULT
lResult
=
0
;
(
*
s_pctxmenu3
->
lpVtbl
->
HandleMenuMsg2
)(
s_pctxmenu3
,
nmsg
,
wparam
,
lparam
,
&
lResult
);
return
lResult
;
}
break
;
case
WM_SIZE
:
if
(
wparam
!=
SIZE_MINIMIZED
)
resize_tree
(
child
,
LOWORD
(
lparam
),
HIWORD
(
lparam
));
...
...
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