728x90
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace screan_detect
{
public partial class Form1 : Form
{
Form2 frm2 = new Form2();
Form3 frm3 = new Form3();
public Form1()
{
InitializeComponent();
this.Load += FormLoad_Event;
}
// Form Load Event Handler
private void FormLoad_Event(object sender, EventArgs e)
{
ScreenDetect();
}
// ๋ค์ค mornitor ๊ฐ์ง
private void ScreenDetect()
{
Screen[] sc = Screen.AllScreens;
if (sc.Length > 1)
{
for (int i = 0; i < sc.Length; i++)
{
Screen screen = (sc[i].WorkingArea.Contains(this.Location)) ? sc[i+1] : sc[i];
if (i == 1)
{
frm2.Show();
frm2.Location = screen.Bounds.Location;
frm2.WindowState = FormWindowState.Maximized;
}
else if (i == 2)
{
frm3.Show();
frm3.Location = screen.Bounds.Location;
frm3.WindowState = FormWindowState.Maximized;
}
Console.WriteLine((i + 1) + "๋ฒ์งธ ๋ชจ๋ํฐ=========================================================");
Console.WriteLine("์ฅ์น์ด๋ฆ : " + sc[i].DeviceName);
Console.WriteLine("์ฃผ๋ชจ๋ํฐ ์ฌ๋ถ : " + sc[i].Primary.ToString());
Console.WriteLine("X ์ขํ : " + sc[i].WorkingArea.X);
Console.WriteLine("Y ์ขํ : " + sc[i].WorkingArea.Y);
Console.WriteLine("Width : " + sc[i].WorkingArea.Width);
Console.WriteLine("Height : " + sc[i].WorkingArea.Height);
Console.WriteLine("==================================================================\n");
}
}
}
}
}
๋ชจ๋ํฐ ๊ฐฏ์ ์ธ์ ํ.. ํผ ๊ฐฏ์ ์๋์ผ๋ก ๋์ด๋ ๊ฒ๋ ํ์ํ ๋ฏ..
์์ง ๋ฏธ์์ด์ด์..
728x90