0

I would like to update my executable. To do this, I am first closing the executable's process (if open). Looking at my options, it looks like Process.CloseMainWindow is the recommended method.

How does the process decide what the main window is? I know how to set the application's main window, but I do not see an option to set the process' main window. The window I want to close is not the window opened on startup. It is also possible that the application will have multiple windows open. I haven't been able to find this information online.

I am using wpf if it is relevant.

3
  • Have you seen this related post? Commented Apr 1, 2024 at 19:28
  • 1
    Every window has a handle number. The handle number are assigned numerically. So the Main Window is the child window of the process with the lowest handle number. Commented Apr 1, 2024 at 19:31
  • Thanks. I was concerned that it had something to do with Focus. I wanted to make sure that the window does not change based on what my users click on. Commented Apr 1, 2024 at 19:39

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.