@@ -43,7 +43,7 @@ private ContextMenu(Shell32.IContextMenu cMenu, User32.SafeHMENU hMenu, IEnumera
43
43
44
44
public async static Task < bool > InvokeVerb ( string verb , params string [ ] filePaths )
45
45
{
46
- using var cMenu = await GetContextMenuForFiles ( filePaths , Shell32 . CMF . CMF_DEFAULTONLY ) ;
46
+ using var cMenu = await GetContextMenuForFiles ( filePaths , CMF . CMF_DEFAULTONLY ) ;
47
47
48
48
return cMenu is not null && await cMenu . InvokeVerb ( verb ) ;
49
49
}
@@ -112,7 +112,7 @@ public async Task<bool> InvokeItem(int itemID)
112
112
return false ;
113
113
}
114
114
115
- public async static Task < ContextMenu ? > GetContextMenuForFiles ( string [ ] filePathList , Shell32 . CMF flags , Func < string , bool > ? itemFilter = null )
115
+ public async static Task < ContextMenu ? > GetContextMenuForFiles ( string [ ] filePathList , CMF flags , Func < string , bool > ? itemFilter = null )
116
116
{
117
117
var owningThread = new ThreadWithMessageQueue ( ) ;
118
118
@@ -140,14 +140,14 @@ public async Task<bool> InvokeItem(int itemID)
140
140
} ) ;
141
141
}
142
142
143
- public async static Task < ContextMenu ? > GetContextMenuForFiles ( ShellItem [ ] shellItems , Shell32 . CMF flags , Func < string , bool > ? itemFilter = null )
143
+ public async static Task < ContextMenu ? > GetContextMenuForFiles ( ShellItem [ ] shellItems , CMF flags , Func < string , bool > ? itemFilter = null )
144
144
{
145
145
var owningThread = new ThreadWithMessageQueue ( ) ;
146
146
147
147
return await owningThread . PostMethod < ContextMenu > ( ( ) => GetContextMenuForFiles ( shellItems , flags , owningThread , itemFilter ) ) ;
148
148
}
149
149
150
- private static ContextMenu ? GetContextMenuForFiles ( ShellItem [ ] shellItems , Shell32 . CMF flags , ThreadWithMessageQueue owningThread , Func < string , bool > ? itemFilter = null )
150
+ private static ContextMenu ? GetContextMenuForFiles ( ShellItem [ ] shellItems , CMF flags , ThreadWithMessageQueue owningThread , Func < string , bool > ? itemFilter = null )
151
151
{
152
152
if ( ! shellItems . Any ( ) )
153
153
return null ;
@@ -159,7 +159,7 @@ public async Task<bool> InvokeItem(int itemID)
159
159
160
160
Shell32 . IContextMenu menu = sf . GetChildrenUIObjects < Shell32 . IContextMenu > ( default , shellItems ) ;
161
161
var hMenu = User32 . CreatePopupMenu ( ) ;
162
- menu . QueryContextMenu ( hMenu , 0 , 1 , 0x7FFF , flags ) ;
162
+ menu . QueryContextMenu ( hMenu , 0 , 1 , 0x7FFF , ( Shell32 . CMF ) flags ) ;
163
163
var contextMenu = new ContextMenu ( menu , hMenu , shellItems . Select ( x => x . ParsingName ) , owningThread , itemFilter ) ;
164
164
contextMenu . EnumMenuItems ( hMenu , contextMenu . Items ) ;
165
165
@@ -174,7 +174,7 @@ public async Task<bool> InvokeItem(int itemID)
174
174
175
175
public static async Task WarmUpQueryContextMenuAsync ( )
176
176
{
177
- using var cMenu = await GetContextMenuForFiles ( new string [ ] { $@ "{ Constants . UserEnvironmentPaths . SystemDrivePath } \" } , Shell32 . CMF . CMF_NORMAL ) ;
177
+ using var cMenu = await GetContextMenuForFiles ( new string [ ] { $@ "{ Constants . UserEnvironmentPaths . SystemDrivePath } \" } , CMF . CMF_NORMAL ) ;
178
178
}
179
179
180
180
private void EnumMenuItems ( HMENU hMenu , List < Win32ContextMenuItem > menuItemsResult , bool loadSubenus = false )
0 commit comments