VirtualDesktopAccessor icon indicating copy to clipboard operation
VirtualDesktopAccessor copied to clipboard

Expose 'create' and 'remove' desktop

Open TheSimpleZ opened this issue 4 years ago • 3 comments
trafficstars

This PR exposes 2 new methods.

int CreateVirtualDesktop() Create a new desktop and return the desktop number. If it fails, it returns -1.

int RemoveVirtualDesktop(int number, int fallbackDesktop) Will remove the desktop with the number number and switch to the desktop number fallbackDesktop. Will return true upon success, otherwise false.

I'm using these in my own project. Just thought it might be useful to others.

TheSimpleZ avatar May 16 '21 01:05 TheSimpleZ

Yes, someone might see these useful. I have implemented these already in my Rust version. I plan to deprecate the C++ part and create the DLL directly from Rust.

Ciantic avatar May 16 '21 10:05 Ciantic

Amazing! What's the status on that .dll? I'm also quite interested in renaming desktops and was planning on implementing it here. But I see that you already have it in Rust.

TheSimpleZ avatar May 16 '21 21:05 TheSimpleZ

@TheSimpleZ I just started the DLL part. It's basically matter of re-exporting those with cdylib, as I have the functions already there.

DLL made with Rust is also great as it doesn't depend on msvcrt anymore either which makes it a bit nicer to use (but the DLL is a bit bigger 200kB). But I've always hated that users must install msvcrt library to use Visual Studio C++ DLLs.

Ciantic avatar May 16 '21 23:05 Ciantic