This is a program in vb.net, but I'm planning to use an outside process by using system.diagnostics.process.start("C:\Otherprogram.exe") Now what I want to do is to resize the default size of window of outside process, can I do that?So that only the things that will be needed by the user can be seen?
A:
You can choose to start the process with a minimized, maximized or normal window (by setting the ProcessStartInfo.WindowStyle and using the Process.Start(ProcessStartInfo) method). However, you don't really have control over the size of the window of the outside process when you start it.
Tarydon
2010-01-01 02:26:05
A:
Once you launch the the program, you can get it's main window handle using Process.MainWindowHandle.
Given the window handle, you should be able to P/Invoke SetWindowPos to position or size that window.
Reed Copsey
2010-01-01 02:27:00
I started writing this, but on re-reading the OP wants to change the *default* window size with which otherprogram.exe *creates* its main window. By the time MainWindowHandle is available, otherprogram.exe may already have shown its window at the "wrong" size, resulting in a nasty visual glitch.
itowlson
2010-01-01 02:29:38
Yeah, unfortunately, this is (I believe) the best you can do, though. (Without control over the other program's code...)
Reed Copsey
2010-01-01 23:21:58