I need to open and also need to able to close a IE window, so I use
Proc = Process.Start("C:\Program Files\Internet Explorer\IEXPLORE.EXE", WebLink)
and
Proc.Kill()
However, I also need to make the IE size to be maximum. How I can do that? Thanks
I would suggest using the
Process.Start()overload that accepts aProcessStartInfoas the parameter. Starting your process using this will allow you to set theProcessStartInfo.WindowStyleproperty to control the window style that the process is to be started with.If the above doesn’t work, you can try to maximize the window by using
ShowWindow()with theSW_MAXIMIZEflag. In order to use native methods from within your managed executable, you will need to use P/Invoke. To get the window handle, you can try using theProcess.MainWindowHandleproperty. If this still doesn’t work you can try usingEnumWindows()to iterate through all of the open windows, checking if they’re owned by your created process by comparing the process ID (Process.Id) to the window’s parent process ID (GetWindowThreadProcessId()).