Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jagadeesan Kandasamy

@Jagadeesan Kandasamy
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Turn-off monitor using c#.net
    J Jagadeesan Kandasamy

    You can try with this code.. [DllImport("user32.dll")] static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); //Or [DllImport("user32.dll", SetLastError = true)] static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); //Or [DllImport("user32.dll")] static extern bool PostThreadMessage(uint idThread, uint Msg, UIntPtr wParam, IntPtr lParam); //Or [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern bool SendMessageCallback(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam, SendMessageDelegate lpCallBack, UIntPtr dwData); //Or [DllImport("user32.dll", SetLastError=true, CharSet=CharSet.Auto)] static extern bool SendNotifyMessage(IntPtr hWnd, uint Msg, UIntPtr wParam, IntPtr lParam); //Or [DllImport("user32.dll")] private static extern IntPtr GetDesktopWindow(); //Or [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindow(string lpClassName, string lpWindowName); //Or [DllImport("user32.dll", SetLastError = true)] static extern IntPtr FindWindowEx(IntPtr hwndParent, IntPtr hwndChildAfter, string lpszClass, string lpszWindow); const int SC_MONITORPOWER = 0xF170; const int WM_SYSCOMMAND = 0x0112; const int MONITORON = -1; const int MONITOROFF = 2; const int MONITORSTANBY = 1; int HWND_BROADCAST = 0xffff; //the message is sent to all top-level windows in the system int HWND_TOPMOST = -1; int HWND_TOP = 0; // int HWND_BOTTOM = 1; //limited use int HWND_NOTOPMOST = -2; // Form frm = new Form(); Frm.Handle(); SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITOROFF ); SendMessage(ValidHWND, WM_SYSCOMMAND, SC_MONITORPOWER, MONITORON);

    Hardware & Devices csharp sysadmin help
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups