5 * word95 gets a IContextMenu Interface and calls HandleMenuMsg()
6 * which should only a member of IContextMenu2.
8 * Copyright (C) 1999 Juergen Schmied
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #ifndef __WINE_WINE_OBJ_CONTEXTMENU_H
26 #define __WINE_WINE_OBJ_CONTEXTMENU_H
30 #endif /* defined(__cplusplus) */
32 typedef struct IContextMenu IContextMenu, *LPCONTEXTMENU;
34 /* QueryContextMenu uFlags */
35 #define CMF_NORMAL 0x00000000
36 #define CMF_DEFAULTONLY 0x00000001
37 #define CMF_VERBSONLY 0x00000002
38 #define CMF_EXPLORE 0x00000004
39 #define CMF_NOVERBS 0x00000008
40 #define CMF_CANRENAME 0x00000010
41 #define CMF_NODEFAULT 0x00000020
42 #define CMF_INCLUDESTATIC 0x00000040
43 #define CMF_RESERVED 0xffff0000 /* View specific */
45 /* GetCommandString uFlags */
46 #define GCS_VERBA 0x00000000 /* canonical verb */
47 #define GCS_HELPTEXTA 0x00000001 /* help text (for status bar) */
48 #define GCS_VALIDATEA 0x00000002 /* validate command exists */
49 #define GCS_VERBW 0x00000004 /* canonical verb (unicode) */
50 #define GCS_HELPTEXTW 0x00000005 /* help text (unicode version) */
51 #define GCS_VALIDATEW 0x00000006 /* validate command exists (unicode) */
52 #define GCS_UNICODE 0x00000004 /* for bit testing - Unicode string */
54 #define GCS_VERB GCS_VERBA
55 #define GCS_HELPTEXT GCS_HELPTEXTA
56 #define GCS_VALIDATE GCS_VALIDATEA
58 #define CMDSTR_NEWFOLDERA "NewFolder"
59 #define CMDSTR_VIEWLISTA "ViewList"
60 #define CMDSTR_VIEWDETAILSA "ViewDetails"
62 # define CMDSTR_NEWFOLDERW (const WCHAR []){ 'N','e','w','F','o','l','d','e','r',0 }
63 # define CMDSTR_VIEWLISTW (const WCHAR []){ 'V','i','e','w','L','i','s','t',0 }
64 # define CMDSTR_VIEWDETAILSW (const WCHAR []){ 'V','i','e','w','D','e','t','a','i','l','s',0 }
65 #elif defined(_MSC_VER)
66 # define CMDSTR_NEWFOLDERW L"NewFolder"
67 # define CMDSTR_VIEWLISTW L"ViewList"
68 # define CMDSTR_VIEWDETAILSW L"ViewDetails"
70 static const WCHAR CMDSTR_NEWFOLDERW[] = {'N','e','w','F','o','l','d','e','r',0};
71 static const WCHAR CMDSTR_VIEWLISTW [] = {'V','i','e','w','L','i','s','t',0};
72 static const WCHAR CMDSTR_VIEWDETAILSW[] = {'V','i','e','w','D','e','t','a','i','l','s',0};
75 #define CMDSTR_NEWFOLDER CMDSTR_NEWFOLDERA
76 #define CMDSTR_VIEWLIST CMDSTR_VIEWLISTA
77 #define CMDSTR_VIEWDETAILS CMDSTR_VIEWDETAILSA
79 #define CMIC_MASK_HOTKEY SEE_MASK_HOTKEY
80 #define CMIC_MASK_ICON SEE_MASK_ICON
81 #define CMIC_MASK_FLAG_NO_UI SEE_MASK_FLAG_NO_UI
82 #define CMIC_MASK_UNICODE SEE_MASK_UNICODE
83 #define CMIC_MASK_NO_CONSOLE SEE_MASK_NO_CONSOLE
84 #define CMIC_MASK_HASLINKNAME SEE_MASK_HASLINKNAME
85 #define CMIC_MASK_FLAG_SEP_VDM SEE_MASK_FLAG_SEPVDM
86 #define CMIC_MASK_HASTITLE SEE_MASK_HASTITLE
87 #define CMIC_MASK_ASYNCOK SEE_MASK_ASYNCOK
89 #define CMIC_MASK_PTINVOKE 0x20000000
91 /*NOTE: When SEE_MASK_HMONITOR is set, hIcon is treated as hMonitor */
92 typedef struct tagCMINVOKECOMMANDINFO
93 { DWORD cbSize; /* sizeof(CMINVOKECOMMANDINFO) */
94 DWORD fMask; /* any combination of CMIC_MASK_* */
95 HWND hwnd; /* might be NULL (indicating no owner window) */
96 LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */
97 LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
98 LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */
99 INT nShow; /* one of SW_ values for ShowWindow() API */
103 } CMINVOKECOMMANDINFO, *LPCMINVOKECOMMANDINFO;
105 typedef struct tagCMInvokeCommandInfoEx
106 { DWORD cbSize; /* must be sizeof(CMINVOKECOMMANDINFOEX) */
107 DWORD fMask; /* any combination of CMIC_MASK_* */
108 HWND hwnd; /* might be NULL (indicating no owner window) */
109 LPCSTR lpVerb; /* either a string or MAKEINTRESOURCE(idOffset) */
110 LPCSTR lpParameters; /* might be NULL (indicating no parameter) */
111 LPCSTR lpDirectory; /* might be NULL (indicating no specific directory) */
112 INT nShow; /* one of SW_ values for ShowWindow() API */
117 LPCSTR lpTitle; /* For CreateProcess-StartupInfo.lpTitle */
118 LPCWSTR lpVerbW; /* Unicode verb (for those who can use it) */
119 LPCWSTR lpParametersW; /* Unicode parameters (for those who can use it) */
120 LPCWSTR lpDirectoryW; /* Unicode directory (for those who can use it) */
121 LPCWSTR lpTitleW; /* Unicode title (for those who can use it) */
122 POINT ptInvoke; /* Point where it's invoked */
124 } CMINVOKECOMMANDINFOEX, *LPCMINVOKECOMMANDINFOEX;
126 #define ICOM_INTERFACE IContextMenu
127 #define IContextMenu_METHODS \
128 ICOM_METHOD5(HRESULT, QueryContextMenu, HMENU, hmenu, UINT, indexMenu, UINT, idCmdFirst, UINT, idCmdLast, UINT, uFlags) \
129 ICOM_METHOD1(HRESULT, InvokeCommand, LPCMINVOKECOMMANDINFO, lpici) \
130 ICOM_METHOD5(HRESULT, GetCommandString, UINT, idCmd, UINT, uType, UINT*, pwReserved, LPSTR, pszName, UINT, cchMax) \
131 ICOM_METHOD3(HRESULT, HandleMenuMsg, UINT, uMsg, WPARAM, wParam, LPARAM, lParam) \
132 void * guard; /*possibly another nasty entry from ContextMenu3 ?*/
133 #define IContextMenu_IMETHODS \
136 ICOM_DEFINE(IContextMenu,IUnknown)
137 #undef ICOM_INTERFACE
139 #define IContextMenu_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
140 #define IContextMenu_AddRef(p) ICOM_CALL(AddRef,p)
141 #define IContextMenu_Release(p) ICOM_CALL(Release,p)
142 #define IContextMenu_QueryContextMenu(p,a,b,c,d,e) ICOM_CALL5(QueryContextMenu,p,a,b,c,d,e)
143 #define IContextMenu_InvokeCommand(p,a) ICOM_CALL1(InvokeCommand,p,a)
144 #define IContextMenu_GetCommandString(p,a,b,c,d,e) ICOM_CALL5(GetCommandString,p,a,b,c,d,e)
145 #define IContextMenu_HandleMenuMsg(p,a,b,c) ICOM_CALL3(HandleMenuMsg,p,a,b,c)
149 #endif /* defined(__cplusplus) */
151 #endif /* __WINE_WINE_OBJ_CONTEXTMENU_H */