You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
1.5 KiB
49 lines
1.5 KiB
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace Binance.TradeRobot.Common.Helpers
|
|
{
|
|
public class ShellExecuteHelper
|
|
{
|
|
public enum ShowCommands : int
|
|
{
|
|
SW_HIDE = 0,
|
|
SW_SHOWNORMAL = 1,
|
|
SW_NORMAL = 1,
|
|
SW_SHOWMINIMIZED = 2,
|
|
SW_SHOWMAXIMIZED = 3,
|
|
SW_MAXIMIZE = 3,
|
|
SW_SHOWNOACTIVATE = 4,
|
|
SW_SHOW = 5,
|
|
SW_MINIMIZE = 6,
|
|
SW_SHOWMINNOACTIVE = 7,
|
|
SW_SHOWNA = 8,
|
|
SW_RESTORE = 9,
|
|
SW_SHOWDEFAULT = 10,
|
|
SW_FORCEMINIMIZE = 11,
|
|
SW_MAX = 11
|
|
}
|
|
|
|
/// <summary>
|
|
/// 内核调用
|
|
/// <para>
|
|
/// ShellExecuteHelper.ShellExecute(IntPtr.Zero, "open", <anyPath>, string.Empty, string.Empty, ShellExecuteHelper.ShowCommands.SW_SHOWNORMAL);
|
|
/// </para>
|
|
/// </summary>
|
|
/// <param name="hwnd"></param>
|
|
/// <param name="lpOperation"></param>
|
|
/// <param name="lpFile"></param>
|
|
/// <param name="lpParameters"></param>
|
|
/// <param name="lpDirectory"></param>
|
|
/// <param name="nShowCmd"></param>
|
|
/// <returns></returns>
|
|
[DllImport("shell32.dll")]
|
|
public static extern IntPtr ShellExecute(
|
|
IntPtr hwnd,
|
|
string lpOperation,
|
|
string lpFile,
|
|
string lpParameters,
|
|
string lpDirectory,
|
|
ShowCommands nShowCmd);
|
|
}
|
|
}
|
|
|