Fixed bug in ShellContextMenu.Invoke (#177)

pull/180/head
dahall 2020-11-14 10:11:15 -07:00
parent 04d33e7e1a
commit 420296f0ab
1 changed files with 9 additions and 4 deletions

View File

@ -165,11 +165,16 @@ namespace Vanara.Windows.Shell
public void InvokeRename() => InvokeVerb("rename");
/// <summary>Invokes the specified verb on the shell item(s).</summary>
public void InvokeVerb(string verb)
/// <param name="verb">The verb to invoke.</param>
/// <param name="show">Flags that specify how to display any opened window.</param>
public void InvokeVerb(string verb, ShowWindowCommand show = ShowWindowCommand.SW_NORMAL)
{
var invoke = new CMINVOKECOMMANDINFOEX();
invoke.cbSize = (uint)Marshal.SizeOf(invoke);
invoke.lpVerb = new SafeResourceId(verb);
var invoke = new CMINVOKECOMMANDINFOEX
{
cbSize = (uint)Marshal.SizeOf(typeof(CMINVOKECOMMANDINFOEX)),
lpVerb = new SafeResourceId(verb, CharSet.Ansi),
nShow = show
};
ComInterface.InvokeCommand(invoke);
}