public static extern IntPtr ShellExecute( IntPtr hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, ShowCommands nShowCmd);
static extern IntPtr ShellExecute( IntPtr hwnd, //用于指定父窗口句柄 string lpOperation, //用于指定要进行的操作.其中open打开FileName指定文件或文件夹 print打印 explore浏览(runas edit find) string lpFileName, //用于指定要操作的文件名或要执行的程序文件名 string lpParameters, //给要打开程序指定参数.若FileName是可执行程序,则此参数指定命令行参数.否则打开的是文件此处参数为nil string lpDirectory, //缺省目录,用于指定默认目录 ShowCommands nShowCmd //打开选项.若FileName参数是可执行程序,则此参数指定程序窗口的初始显示方式,否则此参数为0 );
// need fix: must return error code public static IntPtr ShellExecute( IntPtr parent, string lpOperation, string lpFile, string lpParameters, string lpDirectory, ShowCommands nShowCmd) { return(WinAPI.ShellExecute(parent, lpOperation, lpFile, lpParameters, lpDirectory, nShowCmd)); }
//*************************************************************************** // Class Constructors // /// <summary> /// Provides a managed class for accessing Windows' shell32.dll,ShellExecute unmanaged code. /// </summary> public InteropShellExecute() { this._ShExec = new SHEXECOPSTRUCT(); this._ShExec.hwnd = IntPtr.Zero; this._ShExec.lpDirectory = ""; this._ShExec.lpFile = ""; this._ShExec.lpOperation = null; this._ShExec.lpParameters = ""; this._ShExec.lpShowCmd = ShowCommands.SW_SHOWNORMAL; }
public ShowTests() { var repository = new PromotionContext(new DbContextOptionsBuilder <PromotionContext>() .UseInMemoryDatabase(Guid.NewGuid().ToString()) .Options, null); actCommands = new ActCommands(repository); venueCommands = new VenueCommands(repository); showQueries = new ShowQueries(repository); showCommands = new ShowCommands(repository); }
public CommandManager() { Console.WriteLine("Registering commands..."); #region Command registering Register(Echo.Name, Echo.Info, Echo.NeedsParam, () => Echo.Run(y.ToArray())); Register(Shutdown.Name, Shutdown.Info, Shutdown.NeedsParam, () => Shutdown.Run()); Register(ShowCommands.Name, ShowCommands.Info, ShowCommands.NeedsParam, () => ShowCommands.Run()); Register(Reboot.Name, Reboot.Info, Reboot.NeedsParam, () => Reboot.Run()); Register(Clear.Name, Clear.Info, Clear.NeedsParam, () => Clear.Run()); Register(Cd.Name, Cd.Info, Cd.NeedsParam, () => Cd.Run(y.ToArray()[0])); Register(Ls.Name, Ls.Info, Ls.NeedsParam, () => Ls.Run()); Register(Cat.Name, Cat.Info, Cat.NeedsParam, () => Cat.Run(y.ToArray()[0])); Register(Edit.Name, Edit.Info, Edit.NeedsParam, () => Edit.Run(y.ToArray()[0])); Register(Lspci.Name, Lspci.Info, Lspci.NeedsParam, () => Lspci.Run()); Register(CTime.Name, CTime.Info, CTime.NeedsParam, () => CTime.Run()); Register(MD5.Name, MD5.Info, MD5.NeedsParam, () => MD5.Run(y.ToArray()[0])); Register(SHA256.Name, SHA256.Info, SHA256.NeedsParam, () => SHA256.Run(y.ToArray()[0])); Register(Snake.Name, Snake.Info, Snake.NeedsParam, () => Snake.Run()); #endregion CustomConsole.WriteLineOK("Command Manager initialized"); }
public static extern IntPtr ShellExecute([In, Optional] IntPtr hwnd, [In, Optional] string lpOperation, [In] string lpFile, [In, Optional] string lpParameters, [In, Optional] string lpDirectory, [In] ShowCommands nShowCmd);
private static extern bool ShowWindow(IntPtr hWnd, ShowCommands nCmdShow);