public static int OnSelectionChange(IntPtr thisPtr, IntPtr pfd) { try { Shell32.IFileDialogEvents inst = ComInterfaceDispatch.GetInstance <Shell32.IFileDialogEvents>((ComInterfaceDispatch *)thisPtr); Shell32.IFileDialog fd = (Shell32.IFileDialog)Instance.GetOrCreateObjectForComInstance(pfd, CreateObjectFlags.Unwrap); return((int)inst.OnSelectionChange(fd)); } catch (Exception ex) { return(ex.HResult); } }
public static int OnShareViolation(IntPtr thisPtr, IntPtr pfd, IntPtr psi, Shell32.FDESVR *pResponse) { try { Shell32.IFileDialogEvents inst = ComInterfaceDispatch.GetInstance <Shell32.IFileDialogEvents>((ComInterfaceDispatch *)thisPtr); Shell32.IFileDialog fd = (Shell32.IFileDialog)Instance.GetOrCreateObjectForComInstance(pfd, CreateObjectFlags.Unwrap); Shell32.IShellItem si = (Shell32.IShellItem)Instance.GetOrCreateObjectForComInstance(psi, CreateObjectFlags.Unwrap); return((int)inst.OnShareViolation(fd, si, pResponse)); } catch (Exception ex) { return(ex.HResult); } }
public static int OnFolderChanging(IntPtr thisPtr, IntPtr pfd, IntPtr psiFolder) { try { Shell32.IFileDialogEvents inst = ComInterfaceDispatch.GetInstance <Shell32.IFileDialogEvents>((ComInterfaceDispatch *)thisPtr); Shell32.IFileDialog fd = (Shell32.IFileDialog)Instance.GetOrCreateObjectForComInstance(pfd, CreateObjectFlags.Unwrap); Shell32.IShellItem siFolder = (Shell32.IShellItem)Instance.GetOrCreateObjectForComInstance(psiFolder, CreateObjectFlags.Unwrap); return((int)inst.OnFolderChanging(fd, siFolder)); } catch (Exception ex) { return(ex.HResult); } }