SHC MostWanted
SHC MostWanted

Reputation: 111

Windows 10 - programmatically start up a program in another desktop

Windows 10 has the option for multiple desktops. You can easily switch between them with ctrl + win + left or right arrow. We can also start programs at boot by placing them into start up folder.

I want to start a program (that is placed in the startup folder so that it starts when Windows boots, in case this is relevant) on another desktop rather than the main one. How do I do that?

So Windows boots normally on the main desktop, and my program opens on the 2nd desktop, so that the user that logs in does not notice the program running until they switch to that desktop.

NOTE: I am not trying to hide the program from the user, there are different ways to do this so please do not suggest solutions to this problem. I specifically need it to work in this way (2nd desktop).

Upvotes: 2

Views: 972

Answers (1)

Cody Gray
Cody Gray

Reputation: 244951

Raymond Chen suggested in a comment:

You can use IVirtualDesktopManager::MoveWindowToDesktop to move a window to a specific desktop.

To get the desktop ID, use IVirtualDesktopManager::GetWindowDesktopId of a window already on the desktop you want to move to.

Upvotes: 0

Related Questions