[][src]Struct winvd::VirtualDesktopService

pub struct VirtualDesktopService { /* fields omitted */ }

Provides the stateful helper to accessing the Windows 10 Virtual Desktop functions.

If you don't use other COM objects in your project, you have to use VirtualDesktopService::create_with_com() constructor.

Implementations

impl VirtualDesktopService[src]

pub fn create_with_com() -> Result<VirtualDesktopService, Error>[src]

Initialize service and COM apartment. If you don't use other COM API's, you have to use this initialization.

pub fn create() -> Result<VirtualDesktopService, Error>[src]

Initialize only the service, must be-created on TaskbarCreated message

pub fn get_desktops(&self) -> Result<Vec<DesktopID>, Error>[src]

Get desktops (GUID's)

pub fn get_desktop_count(&self) -> Result<u32, Error>[src]

Get number of desktops

pub fn get_current_desktop(&self) -> Result<DesktopID, Error>[src]

Get current desktop GUID

pub fn get_desktop_by_window(&self, hwnd: HWND) -> Result<DesktopID, Error>[src]

Get window desktop ID

pub fn is_window_on_current_virtual_desktop(
    &self,
    hwnd: HWND
) -> Result<bool, Error>
[src]

Is window on current virtual desktop

pub fn is_window_on_desktop(
    &self,
    hwnd: HWND,
    desktop: &DesktopID
) -> Result<bool, Error>
[src]

Is window on desktop

pub fn move_window_to_desktop(
    &self,
    hwnd: HWND,
    desktop: &DesktopID
) -> Result<(), Error>
[src]

Move window to desktop

pub fn go_to_desktop(&self, desktop: &DesktopID) -> Result<(), Error>[src]

Go to desktop

pub fn is_pinned_window(&self, hwnd: HWND) -> Result<bool, Error>[src]

Is window pinned?

pub fn pin_window(&self, hwnd: HWND) -> Result<(), Error>[src]

Pin window

pub fn unpin_window(&self, hwnd: HWND) -> Result<(), Error>[src]

Unpin window

pub fn on_desktop_change(&self, callback: Box<dyn Fn(DesktopID, DesktopID)>)[src]

Callback for desktop change event, callback gets old desktop id, and new desktop id

pub fn on_desktop_created(&self, callback: Box<dyn Fn(DesktopID)>)[src]

Callback for desktop creation, callback recieves new desktop id

pub fn on_desktop_destroyed(&self, callback: Box<dyn Fn(DesktopID)>)[src]

Callback for on desktop destroy event, callback recieves old desktop id

pub fn on_window_change(&self, callback: Box<dyn Fn(HWND)>)[src]

Callback for window changes, e.g. if window changes to different desktop, or window gets destroyed. Callback recieves HWND of thumbnail window (most likely top level window HWND).

Note This can be a very chatty callback, and may have some false positives.

Trait Implementations

impl Drop for VirtualDesktopService[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.