P/呼び出しのためにshell32.dll's SHMultiFileProperties
質問
私は良くないのP/を呼び出す.誰でもできるので仕方を教えてください。を宣言し、以下のshell32.dll 機能です。います。
から http://msdn.microsoft.com/en-us/library/bb762230%28VS.85%29.aspx:
HRESULT SHMultiFileProperties(
IDataObject *pdtobj,
DWORD dwFlags
);
で表示するためにWindowsシェルのプロパティ]ダイアログのための複数ファイルシステムオブジェクト。
いて把握の使い方SHObjectProperties一つのファイルやフォルダー:
[DllImport("shell32.dll", SetLastError = true)]
static extern bool SHObjectProperties(uint hwnd, uint shopObjectType, [MarshalAs(UnmanagedType.LPWStr)] string pszObjectName, [MarshalAs(UnmanagedType.LPWStr)] string pszPropertyPage);
public static void ShowDialog(Form parent, FileSystemInfo selected)
{
SHObjectProperties((uint)parent.Handle, (uint)ObjectType.File, selected.FullName, null));
}
enum ObjectType
{
Printer = 0x01,
File = 0x02,
VoumeGuid = 0x04,
}
誰でもできるのですか?
解決
あり IDataObject タ DataObject クラス。NET Framework.
[DllImport("shell32.dll", SetLastError = true)]
static extern int SHMultiFileProperties(IDataObject pdtobj, int flags);
public static void Foo()
{
var pdtobj = new DataObject();
pdtobj.SetFileDropList(new StringCollection { @"C:\Users", @"C:\Windows" });
if (SHMultiFileProperties(pdtobj, 0) != 0 /*S_OK*/)
{
throw new Win32Exception();
}
}
編集: ろめることで作品(ポップアップします一部ダイアログとフォルダの外観設定).
他のヒント
私は多分あなたは間違って質問読んで、私はあなたがファイル用の拡張ファイルのプロパティを探していると思います。すなわち、Windowsエクスプローラを開き、など作成した属性、所有者、著作権、サイズ、日付のような列を表示する?
この情報を提供しますGetDetailsOf呼ばShell32はでAPIがあります。 CodeProjectのの上の開始の記事 乾杯、 ジョン
所属していません StackOverflow