2009. 10. 7. 10:47
미니 팝업창
모니터 제어
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
// 모니터 ON/OFF 관련
const int WM_SYSCOMMAND = 0x0112;
const int SC_MONITORPOWER = 0xF170;
const int MONITOR_ON = -1;
const int MONITOR_OFF = 2;
const int MONITOR_STANBY = 1;
[System.Runtime.InteropServices.DllImport("User32")]
private static extern int SendMessage(int hWnd, int hMsg, int wParam, int lParam);
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
SendMessage(this.Handle.ToInt32(), WM_SYSCOMMAND, SC_MONITORPOWER, MONITOR_OFF);
}
}
}
'IT > TIP&TALK' 카테고리의 다른 글
프록시 서버(proxy server) 구축 - freeproxy (0) | 2009.10.22 |
---|---|
Microsoft Windows 2003 Server 설치 및 최적화 설정 (0) | 2009.10.22 |
닷넷에서 native dll 사용하기 (0) | 2009.09.29 |
App.Config XML읽고 쓰기.. (0) | 2009.09.08 |
[응용프로그램조이기] 키 상수값 (Virtual-Key Codes) (0) | 2009.09.08 |