日期:2014-05-18 浏览次数:21269 次
void CloseLCD(object sender, EventArgs e) { SendMessage(this.Handle, WM_SYSCOMMAND, SC_MONITORPOWER, 2); // 2 为关闭显示器, -1则打开显示器 } SendMessage#region SendMessage public const uint WM_SYSCOMMAND = 0x0112; public const uint SC_MONITORPOWER = 0xF170; [DllImport("user32")] public static extern IntPtr SendMessage(IntPtr hWnd, uint wMsg, uint wParam, int lParam); #endregion
------解决方案--------------------
找找相应的API。
------解决方案--------------------
Eject USB disks using C#http://www.codeproject.com/KB/system/usbeject.aspx