Any way to create a hidden main window in C#?

前端 未结 12 999
粉色の甜心
粉色の甜心 2020-12-25 13:02

I just want a c# application with a hidden main window that will process and respond to window messages.

I can create a form without showing it, and can then call Ap

12条回答
  •  眼角桃花
    2020-12-25 13:31

    The best way is to use the following 1-2 lines in the constuctor:

    this.WindowState = FormWindowState.Minimized;
    this.ShowInTaskbar = false; // This is optional
    

    You can even set the Minimized property in the VS Property window.

提交回复
热议问题