Struct winsafe::IFileDialogEvents
source · pub struct IFileDialogEvents(/* private fields */);
Available on crate feature
shell
only.Expand description
IFileDialogEvents
COM interface over IFileDialogEventsVT
.
Automatically calls
IUnknown::Release
when the object goes out of scope.
§Examples
use winsafe::{self as w, prelude::*, co};
let hparent: w::HWND; // initialized somewhere
let file_open = w::CoCreateInstance::<w::IFileOpenDialog>(
&co::CLSID::FileOpenDialog,
None,
co::CLSCTX::INPROC_SERVER,
)?;
let file_dialog_events = w::IFileDialogEvents::new_impl();
file_dialog_events.OnFolderChanging(
move |fd: &w::IFileDialog, si: &w::IShellItem| -> w::HrResult<()> {
println!("New folder: {}",
si.GetDisplayName(co::SIGDN::FILESYSPATH)?);
Ok(())
},
);
file_open.Advise(&file_dialog_events)?;
Implementations§
source§impl IFileDialogEvents
impl IFileDialogEvents
sourcepub fn OnFileOk<F>(&self, func: F)
pub fn OnFileOk<F>(&self, func: F)
IFileDialogEvents::OnFileOk
method.
sourcepub fn OnFolderChange<F>(&self, func: F)
pub fn OnFolderChange<F>(&self, func: F)
sourcepub fn OnFolderChanging<F>(&self, func: F)
pub fn OnFolderChanging<F>(&self, func: F)
sourcepub fn OnOverwrite<F>(&self, func: F)
pub fn OnOverwrite<F>(&self, func: F)
IFileDialogEvents::OnOverwrite
method.
sourcepub fn OnSelectionChange<F>(&self, func: F)
pub fn OnSelectionChange<F>(&self, func: F)
sourcepub fn OnTypeChange<F>(&self, func: F)
pub fn OnTypeChange<F>(&self, func: F)
IFileDialogEvents::OnTypeChange
method.
Trait Implementations§
source§impl Clone for IFileDialogEvents
impl Clone for IFileDialogEvents
source§impl Drop for IFileDialogEvents
impl Drop for IFileDialogEvents
source§impl ole_IUnknown for IFileDialogEvents
impl ole_IUnknown for IFileDialogEvents
source§unsafe fn from_ptr(_p: *mut c_void) -> Self
unsafe fn from_ptr(_p: *mut c_void) -> Self
Available on crate feature
ole
only.Creates an object from a COM virtual table pointer. Read more
source§unsafe fn as_mut(&mut self) -> &mut *mut c_void
unsafe fn as_mut(&mut self) -> &mut *mut c_void
Available on crate feature
ole
only.Returns a mutable reference do the underlying COM virtual table pointer. Read more
source§fn ptr(&self) -> *mut c_void
fn ptr(&self) -> *mut c_void
Available on crate feature
ole
only.Returns the pointer to the underlying COM virtual table. Read more
source§unsafe fn null() -> Self
unsafe fn null() -> Self
Available on crate feature
ole
only.Creates an object from a null COM virtual table pointer. Read more
source§fn QueryInterface<T>(&self) -> HrResult<T>where
T: ole_IUnknown,
fn QueryInterface<T>(&self) -> HrResult<T>where
T: ole_IUnknown,
Available on crate feature
ole
only.IUnknown::QueryInterface
method.impl Send for IFileDialogEvents
Auto Trait Implementations§
impl Freeze for IFileDialogEvents
impl !RefUnwindSafe for IFileDialogEvents
impl !Sync for IFileDialogEvents
impl Unpin for IFileDialogEvents
impl !UnwindSafe for IFileDialogEvents
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more