Hide Command Window in C# Application

前端 未结 4 1470
温柔的废话
温柔的废话 2020-12-10 03:50

Before you say its a duplicate question, please let me explain (as I\'ve read all similar threads).

My application has both of these settings:

  proc         


        
4条回答
  •  遥遥无期
    2020-12-10 04:13

    I had a similar task - It is possible to hide the window after creation via an API call. (In your case you maybe need a helper thread.)

    [DllImport("user32.dll")]
    static extern bool ShowWindow(IntPtr hWnd, int nCmdShow);
    

    If you know the handle of the new Window you can call

    ShowWindow(hWnd, 0);
    

    0 hides the window, 1 shows the window

    To get the handle of the Window take a look at:

    pinvoke.net enumwindows(user32)

提交回复
热议问题