I learn some API form here https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-enumdesktopsa and access violation when switching desktops
I know how to create a virtual desktop,like Win+Ctrl+D.
However, I want to go to the next desktop, like Win+Ctrl+-> or Win+Ctrl+<-, go to desktop1 or desktop2.
I know here is an API BOOL SwitchDesktop([in] HDESK hDesktop);
, but I don't know how to get HDESK of desktop2, 3, 4.
Is there an API like switchToNextDesktop
, swithToLeftDesktop
and switchToRightDesktop
?
Is there an API that can let me know the HDESK of desktop2, 3, 4, 5? The desktop2, 3, 4, 5 is created by Win+Ctrl+D.
Maybe C# has some function? What about C++?