Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Process.Start and Dual Monitors

if I'm using Process.Start to open a file from a C# WinForms app, is there any way to control which monitor the pdf (or whatever) opens in?

like image 467
Adam Rackis Avatar asked Sep 16 '10 19:09

Adam Rackis


1 Answers

You'll need to do two things: get the window handle of the application (e.g. Acrobat Reader for a PDF) then move it to the monitor you want and Maximize.

These two articles should get you started:

Controlling Window State Of Other Applications using C#:
http://www.c-sharpcorner.com/UploadFile/gaurav.pilay/206232006095904AM/2.aspx

Multi-monitor programming in C#:
http://www.codeproject.com/KB/cs/multi-monitor_in_c_.aspx

like image 79
Dave Swersky Avatar answered Sep 19 '22 01:09

Dave Swersky