mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-06 11:16:51 +02:00
* removed IWorkArea interface * split work area initialization * changed rect type in zoneset * tests upd work area tests removed obsolete, update others updated work area tests * get current vd windows * update windows positions * removed unused flag * moved update window positions to work area * check monitor * refactoring
36 lines
1.1 KiB
C++
36 lines
1.1 KiB
C++
#pragma once
|
|
|
|
class VirtualDesktop
|
|
{
|
|
public:
|
|
static VirtualDesktop& instance();
|
|
|
|
// saved values
|
|
GUID GetCurrentVirtualDesktopId() const noexcept;
|
|
GUID GetPreviousVirtualDesktopId() const noexcept;
|
|
void UpdateVirtualDesktopId() noexcept;
|
|
|
|
// IVirtualDesktopManager
|
|
bool IsWindowOnCurrentDesktop(HWND window) const;
|
|
std::optional<GUID> GetDesktopId(HWND window) const;
|
|
std::optional<GUID> GetDesktopIdByTopLevelWindows() const;
|
|
std::vector<std::pair<HWND, GUID>> GetWindowsRelatedToDesktops() const;
|
|
std::vector<HWND> GetWindowsFromCurrentDesktop() const;
|
|
|
|
// registry
|
|
std::optional<GUID> GetCurrentVirtualDesktopIdFromRegistry() const;
|
|
std::optional<std::vector<GUID>> GetVirtualDesktopIdsFromRegistry() const;
|
|
bool IsVirtualDesktopIdSavedInRegistry(GUID id) const;
|
|
|
|
private:
|
|
VirtualDesktop();
|
|
~VirtualDesktop();
|
|
|
|
IVirtualDesktopManager* m_vdManager{nullptr};
|
|
|
|
GUID m_currentVirtualDesktopId{};
|
|
GUID m_previousDesktopId{};
|
|
|
|
std::optional<std::vector<GUID>> GetVirtualDesktopIdsFromRegistry(HKEY hKey) const;
|
|
};
|