Turn Off Monitor Power in Windows Using DDC/CI (C++)

Download Project Source for MSVC2013
Download Demo Executable

The simplest way in Windows to turn the monitor off is to call SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2);. Unfortunately this call causes the monitor to gradually fade out and since I needed the monitor to turn off immediately I had to find an alternative way.

In order to power the monitor off immediately I ended up using low level monitor configuration functions that provide access to Display Data Channel Command Interface (DDC/CI). To familiarize yourself with these functions please read Using the Low-Level Monitor Configuration Functions.

NOTE: Not all monitors support the DDC/CI power manipulation

I have created Monitors class that powers off/on all the connected monitors. Below is the sample usage:

Following is the listing of the internals of Monitor class: