System.Diagnosis.Process Set Bounds
-
Hello, I am working in Visual Studio.NET 2003. I just want to ask if there is any way I could tell System.Diagnosis.Process to start a new process/window on my desired location. Actually I am working in a Multiple Monitor environment and want System.Diagnosis.Process to open on the second monitor (by setting up location)
Dim p As System.Diagnostics.Process Dim pinfo As New System.Diagnostics.ProcessStartInfo pinfo.Arguments = "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\Picture 001.jpg" pinfo.FileName = "C:\windows\system32\rundll32.exe" Process.Start(pinfo)
Above is a code which i am using to open up Windows Picture and Fax viewer(of which i want to set the location of) Thanks,
Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.
-
Hello, I am working in Visual Studio.NET 2003. I just want to ask if there is any way I could tell System.Diagnosis.Process to start a new process/window on my desired location. Actually I am working in a Multiple Monitor environment and want System.Diagnosis.Process to open on the second monitor (by setting up location)
Dim p As System.Diagnostics.Process Dim pinfo As New System.Diagnostics.ProcessStartInfo pinfo.Arguments = "C:\WINDOWS\System32\shimgvw.dll,ImageView_Fullscreen c:\Picture 001.jpg" pinfo.FileName = "C:\windows\system32\rundll32.exe" Process.Start(pinfo)
Above is a code which i am using to open up Windows Picture and Fax viewer(of which i want to set the location of) Thanks,
Mubashir Software Architect Storan Technologies Inc, USA Every job is a self portrait of the person who did it.
You can't tell it which monitor to start on. An application will always show up on the primary monitor, then you move it to the monitor you want. The exception to this is if the application was run before and it saved it's last position, before it closed, so that it can recreate it's window in that same position the next time it runs. So, you're only choice is to launch the application, get it's window handle, by calling the Win32 API function FindWindow, then sending the appropriate window messages to that handle to move it to the desktop coordinates on the next monitor.
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007