0

I tried to set the WindowState of the System.Diagnostics.Process object but that didn't work. Neither did the WinAPI ShowWindow function because it requires a handle to a Window which I cannot acquire because the window that I want to show is hidden (Meaning that its MainWindowHandle defaults to Zero when I call MainWindowHandle on the Process object.)

Can someone tell me how to accomplish this?

John Smith
  • 4,416
  • 7
  • 41
  • 56

1 Answers1

1

Just because MainWindowHandle is zero, it does not necessarily mean you cannot get a handle to the window. By convention, the MainWindowHandle is the first window the application creates, but it can be a bit hit and miss. Having it return zero is not unusual.

You should use EnumWindows to find the windows owned by a process.

Michael
  • 8,891
  • 3
  • 29
  • 42