Any way to use this interface from PB?
https://docs.microsoft.com/en-us/window ... topmanager
The IVirtualDesktopManager interface has these methods.
Method Description
IVirtualDesktopManager::GetWindowDesktopId Gets the identifier for the virtual desktop hosting the provided top-level window.
IVirtualDesktopManager::IsWindowOnCurrentVirtualDesktop Indicates whether the provided window is on the currently active virtual desktop.
IVirtualDesktopManager::MoveWindowToDesktop Moves a window to the specified virtual desktop.
The API is incomplete IMHO (missing enumeration for example). You wonder why MS started from scratch instead of improving the existing flat win32 virtual desktop API... but whatever.
IVirtualDesktopManager (Windows 10)
Re: IVirtualDesktopManager (Windows 10)
I came up with this:
Not sure if it works (i have no Windows 10 right now)
Code: Select all
EnableExplicit
Interface IVirtualDesktopManager
IsWindowOnCurrentVirtualDesktop.i(*topLevelWindow)
GetWindowDesktopId.i(*topLevelWindow)
MoveWindowToDesktop.i(*topLevelWindow,*desktopId)
EndInterface
Procedure.i GetIVirtualDesktopManager()
Protected cid.CLSID
Protected iid.CLSID
Protected vtable.i
If CoInitialize_(#Null) = #S_OK
If CLSIDFromString_("{AA509086-5CA9-4C25-8F95-589D3C07B48A}",@cid) = #S_OK
If IIDFromString_("{A5CD92FF-29BE-454C-8D04-D82879FB3F1B}",@iid) = #S_OK
If CoCreateInstance_(@cid,#Null,#CLSCTX_INPROC_SERVER,@iid,@vtable) = #S_OK
ProcedureReturn vtable
EndIf
EndIf
EndIf
CoUninitialize_()
EndIf
ProcedureReturn #Null
EndProcedure
Global *VirtualDesktopManager.IVirtualDesktopManager
*VirtualDesktopManager = GetIVirtualDesktopManager()
If *VirtualDesktopManager
Debug "Interface is ready!"
Else
Debug "Error!"
EndIf
End
Re: IVirtualDesktopManager (Windows 10)
Ok now i was able to run it on Windows 10
The interface gets created but it may look different:
Does this work?
The interface gets created but it may look different:
Code: Select all
Interface IVirtualDesktopManager
IsWindowOnCurrentVirtualDesktop.i(topLevelWindow.i,*onCurrentDesktop.b)
GetWindowDesktopId.i(topLevelWindow.i,*desktopId)
MoveWindowToDesktop.i(topLevelWindow.i,*desktopId)
EndInterface
- Kwai chang caine
- Always Here
- Posts: 5342
- Joined: Sun Nov 05, 2006 11:42 pm
- Location: Lyon - France
Re: IVirtualDesktopManager (Windows 10)
In the two case the debugger say "Interface is ready!" with W10 X64 / v5.70 X86
The happiness is a road...
Not a destination
Not a destination