C# Process.MainWindowHandle always returns IntPtr Zero
The main window is the window opened by the process that currently has the focus (the TopLevel form). You must use the Refresh method to refresh the Process object to get the current main window handle if it has changed. You can get the MainWindowHandle property only for processes that are running on the local … Read more