简体   繁体   中英

Start process on a specific desktop

How to start a Windows process on a specific Windows Desktop?

Preferably, we are looking for a solution, which is supported on Windows 8.1 as well, ie which does not rely on Windows 10's new task view feature. I know, that different desktops are not easily user-accessible in Windows 8.1, still, they are supported.

Our goal is to enable developers running our web test suite in the background - no interfering of the browser window with their work.

Unfortunately, a Google search didn't turn up anyhting :-(

Note: although we're using .NET/C#, we are perfectly happy with a WinAPI call as well.

You can use STARTUPINFO.lpDesktop when creating the process via CreateProcess . For an example, see Start process on the other desktop, Python, Windows .

However, this requires having control over the process creation. To get a web test suite to run on another desktop, you'll probably have to patch this into your web test runner (eg, ChromeDriver ) somehow.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM