Beispiel #1
0
        /// <summary>
        ///     指定したファイルまたはフォルダーのプロパティダイアログを表示します。
        /// </summary>
        /// <param name="path">ファイルまたはフォルダーのパス。</param>
        public static void ShowProperty(string path)
        {
            Contract.Requires <ArgumentException>(!String.IsNullOrWhiteSpace(path));

            var shei = SHELLEXECUTEINFO.Create(HWND_DESKTOP);

            shei.fMask  = SEE_MASK.SEE_MASK_NOCLOSEPROCESS | SEE_MASK.SEE_MASK_INVOKEIDLIST | SEE_MASK.SEE_MASK_FLAG_NO_UI;
            shei.lpFile = path;
            shei.lpVerb = "properties";
            shei.nShow  = SW_HIDE;

            WindowsShellNativeMethods.ShellExecuteEx(ref shei);
        }
        /// <summary>
        ///     Initialize a new instance of the <see cref="ShellImageList" /> class
        ///     to the specified image size.
        /// </summary>
        /// <param name="size">Image size.</param>
        public ShellImageList(int size)
        {
            var iid = ControlGuid.IID_IImageList;

            WindowsShellNativeMethods.SHGetImageList(size, ref iid, out this.imageList);
        }