1 /************************************************************
5 * word95 gets a IContextMenu Interface and calls HandleMenuMsg()
6 * whitch should only a member of IContextMenu2.
9 #ifndef __WINE_WINE_OBJ_CONTEXTMENU_H
10 #define __WINE_WINE_OBJ_CONTEXTMENU_H
15 #include "wine/obj_base.h"
19 #endif /* defined(__cplusplus) */
21 DEFINE_SHLGUID(IID_IContextMenu
, 0x000214E4L
, 0, 0);
22 DEFINE_SHLGUID(IID_IContextMenu2
, 0x000214F4L
, 0, 0);
23 typedef struct IContextMenu IContextMenu
, *LPCONTEXTMENU
;
25 /* QueryContextMenu uFlags */
26 #define CMF_NORMAL 0x00000000
27 #define CMF_DEFAULTONLY 0x00000001
28 #define CMF_VERBSONLY 0x00000002
29 #define CMF_EXPLORE 0x00000004
30 #define CMF_NOVERBS 0x00000008
31 #define CMF_CANRENAME 0x00000010
32 #define CMF_NODEFAULT 0x00000020
33 #define CMF_INCLUDESTATIC 0x00000040
34 #define CMF_RESERVED 0xffff0000 /* View specific */
36 /* GetCommandString uFlags */
37 #define GCS_VERBA 0x00000000 /* canonical verb */
38 #define GCS_HELPTEXTA 0x00000001 /* help text (for status bar) */
39 #define GCS_VALIDATEA 0x00000002 /* validate command exists */
40 #define GCS_VERBW 0x00000004 /* canonical verb (unicode) */
41 #define GCS_HELPTEXTW 0x00000005 /* help text (unicode version) */
42 #define GCS_VALIDATEW 0x00000006 /* validate command exists (unicode) */
43 #define GCS_UNICODE 0x00000004 /* for bit testing - Unicode string */
45 #define GCS_VERB GCS_VERBA
46 #define GCS_HELPTEXT GCS_HELPTEXTA
47 #define GCS_VALIDATE GCS_VALIDATEA
49 #define CMDSTR_NEWFOLDERA "NewFolder"
50 #define CMDSTR_VIEWLISTA "ViewList"
51 #define CMDSTR_VIEWDETAILSA "ViewDetails"
52 #define CMDSTR_NEWFOLDERW L"NewFolder"
53 #define CMDSTR_VIEWLISTW L"ViewList"
54 #define CMDSTR_VIEWDETAILSW L"ViewDetails"
56 #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
57 #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
58 #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
60 #define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
61 #define CMIC_MASK_ICON SEE_MASK_ICON
62 #define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
63 #define CMIC_MASK_UNICODE SEE_MASK_UNICODE
64 #define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
65 #define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
66 #define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
67 #define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
68 #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
70 #define CMIC_MASK_PTINVOKE 0x20000000
72 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
73 typedef struct tagCMINVOKECOMMANDINFO
74 { DWORD cbSize
; /* sizeof(CMINVOKECOMMANDINFO) */
75 DWORD fMask
; /* any combination of CMIC_MASK_* */
76 HWND hwnd
; /* might be NULL (indicating no owner window) */
77 LPCSTR lpVerb
; /* either a string or MAKEINTRESOURCE(idOffset) */
78 LPCSTR lpParameters
; /* might be NULL (indicating no parameter) */
79 LPCSTR lpDirectory
; /* might be NULL (indicating no specific directory) */
80 INT nShow
; /* one of SW_ values for ShowWindow() API */
84 } CMINVOKECOMMANDINFO
, *LPCMINVOKECOMMANDINFO
;
86 typedef struct tagCMInvokeCommandInfoEx
87 { DWORD cbSize
; /* must be sizeof(CMINVOKECOMMANDINFOEX) */
88 DWORD fMask
; /* any combination of CMIC_MASK_* */
89 HWND hwnd
; /* might be NULL (indicating no owner window) */
90 LPCSTR lpVerb
; /* either a string or MAKEINTRESOURCE(idOffset) */
91 LPCSTR lpParameters
; /* might be NULL (indicating no parameter) */
92 LPCSTR lpDirectory
; /* might be NULL (indicating no specific directory) */
93 INT nShow
; /* one of SW_ values for ShowWindow() API */
98 LPCSTR lpTitle
; /* For CreateProcess-StartupInfo.lpTitle */
99 LPCWSTR lpVerbW
; /* Unicode verb (for those who can use it) */
100 LPCWSTR lpParametersW
; /* Unicode parameters (for those who can use it) */
101 LPCWSTR lpDirectoryW
; /* Unicode directory (for those who can use it) */
102 LPCWSTR lpTitleW
; /* Unicode title (for those who can use it) */
103 POINT ptInvoke
; /* Point where it's invoked */
105 } CMINVOKECOMMANDINFOEX
, *LPCMINVOKECOMMANDINFOEX
;
107 #define ICOM_INTERFACE IContextMenu
108 #define IContextMenu_METHODS \
109 ICOM_METHOD5(HRESULT, QueryContextMenu, HMENU, hmenu, UINT, indexMenu, UINT, idCmdFirst, UINT, idCmdLast, UINT, uFlags) \
110 ICOM_METHOD1(HRESULT, InvokeCommand, LPCMINVOKECOMMANDINFO, lpici) \
111 ICOM_METHOD5(HRESULT, GetCommandString, UINT, idCmd, UINT, uType, UINT*, pwReserved, LPSTR, pszName, UINT, cchMax) \
112 ICOM_METHOD3(HRESULT, HandleMenuMsg, UINT, uMsg, WPARAM, wParam, LPARAM, lParam) \
113 void * guard; /*possibly another nasty entry from ContextMenu3 ?*/
114 #define IContextMenu_IMETHODS \
117 ICOM_DEFINE(IContextMenu
,IUnknown
)
118 #undef ICOM_INTERFACE
120 #define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
121 #define IContextMenu_AddRef(p) ICOM_CALL(AddRef,p)
122 #define IContextMenu_Release(p) ICOM_CALL(Release,p)
123 #define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e)
124 #define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a)
125 #define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e)
126 #define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c)
130 #endif /* defined(__cplusplus) */
132 #endif /* __WINE_WINE_OBJ_CONTEXTMENU_H */