C# - Launch Invisible Process (CreateNoWindow & WindowStyle not working?)

前端 未结 4 897
遇见更好的自我
遇见更好的自我 2020-12-30 05:34

I have 2 programs (.exe) which I\'ve created in .NET. We\'ll call them the Master and the Worker. The Master starts 1 or more Workers. The Worker will not

4条回答
  •  臣服心动
    2020-12-30 05:55

    The problem is with UseShellExecute = false, set this to true and the process will be started as hidden. Using the shell to start the process understands how to make the application hidden, where as starting the process directly with UseShellExecute = false starts the process directly, and as Chris Schmich mentioned, you'd have to handle hiding the window from inside the client application. This might be more desirable if you want the option of running the application manually for debugging or testing purposes.

提交回复
热议问题