예제 #1
0
 public static void ShowProperties(byte[] idl, IntPtr hwnd = default(IntPtr))
 {
     using (SafePtr sptr = new SafePtr("properties"))
         using (IDLWrapper wrapper = new IDLWrapper(idl)) {
             if (wrapper.Available)
             {
                 SHELLEXECUTEINFO structure = new SHELLEXECUTEINFO {
                     hwnd     = hwnd,
                     fMask    = 0x40C,
                     lpVerb   = sptr,
                     lpIDList = wrapper.PIDL
                 };
                 structure.cbSize = Marshal.SizeOf(structure);
                 PInvoke.ShellExecuteEx(ref structure);
             }
         }
 }
예제 #2
0
        public static void ShowProperties(byte[] idl)
        {
            SHELLEXECUTEINFO structure = new SHELLEXECUTEINFO();

            structure.cbSize = Marshal.SizeOf(structure);
            structure.fMask  = 0x40c;
            structure.lpVerb = Marshal.StringToHGlobalUni("properties");
            try {
                using (IDLWrapper wrapper = new IDLWrapper(idl)) {
                    if (wrapper.Available)
                    {
                        structure.lpIDList = wrapper.PIDL;
                        PInvoke.ShellExecuteEx(ref structure);
                    }
                }
            }
            finally {
                if (structure.lpVerb != IntPtr.Zero)
                {
                    Marshal.FreeHGlobal(structure.lpVerb);
                }
            }
        }