/// <summary> /// Opens up a folder in File Explorer /// </summary> /// <param name="foldername"></param> /// <returns></returns> public static bool ShowFolderExplorer(string foldername) { SHELLEXECUTEINFO info = new SHELLEXECUTEINFO(); info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info); info.lpVerb = "open"; info.lpFile = foldername; info.nShow = SW_SHOW; info.fMask = SEE_MASK_INVOKEIDLIST; return(ShellExecuteEx(ref info)); }
/// <summary> /// Shows the property Shell window /// </summary> /// <param name="filename"></param> /// <returns></returns> public static bool ShowPropertiesWindow(string filename) { SHELLEXECUTEINFO info = new SHELLEXECUTEINFO(); info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info); info.lpVerb = "properties"; info.lpFile = filename; info.nShow = SW_SHOW; info.fMask = SEE_MASK_INVOKEIDLIST; return(ShellExecuteEx(ref info)); }
internal static extern bool ShellExecuteEx(ref SHELLEXECUTEINFO lpExecInfo);
/// <summary> /// Shows the property Shell window /// </summary> /// <param name="filename"></param> /// <returns></returns> public static bool ShowPropertiesWindow(string filename) { SHELLEXECUTEINFO info = new SHELLEXECUTEINFO(); info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info); info.lpVerb = "properties"; info.lpFile = filename; info.nShow = SW_SHOW; info.fMask = SEE_MASK_INVOKEIDLIST; return ShellExecuteEx(ref info); }
/// <summary> /// Opens up a folder in File Explorer /// </summary> /// <param name="foldername"></param> /// <returns></returns> public static bool ShowFolderExplorer(string foldername) { SHELLEXECUTEINFO info = new SHELLEXECUTEINFO(); info.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(info); info.lpVerb = "open"; info.lpFile = foldername; info.nShow = SW_SHOW; info.fMask = SEE_MASK_INVOKEIDLIST; return ShellExecuteEx(ref info); }