Setting process window size and location before process.start()

后端 未结 2 1181
清歌不尽
清歌不尽 2021-01-22 13:44

I am using a form to start new flash processes using Process.start() and MoveWindow() to resize and change the process window location. The problem is before MoveWindow() is cal

2条回答
  •  野性不改
    2021-01-22 14:03

    Look at the ProcessStartInfo.WindowStyle. You should be able to set it to start as Hidden until you've moved and resized it and then set it back to normal.

    See here:

    The hidden window style. A window can be either visible or hidden. The system displays a hidden window by not drawing it. If a window is hidden, it is effectively disabled. A hidden window can process messages from the system or from other windows, but it cannot process input from the user or display output. Frequently, an application may keep a new window hidden while it customizes the window's appearance, and then make the window style Normal. To use ProcessWindowStyle.Hidden, the ProcessStartInfo.UseShellExecute property must be false.

    For how to change the style after the process has started, see this question:

    Toggle Process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden at runtime

提交回复
热议问题