Jan 24, 2016 05:31 PM
(This post was last modified: Jan 24, 2016 05:49 PM by Deathskully66.)
Well Guys i was Really bored Today so I wanted to make a C++ console application. This application lets your Monitor Sleep for a few seconds.
I added comments so you guys who are new to C++ can understand the code.
Link:w ww.mediafire.com/download/36gw25c6ouvhzb2/ TurnOffMonitor.rar
I placed some spaces since i cant make a link yet so yea Enjoy.
Well looks like i made a mistake, if u have Visual Studio 2015 or probably any VS start it and you will see the effects.
I added comments so you guys who are new to C++ can understand the code.
Link:w ww.mediafire.com/download/36gw25c6ouvhzb2/ TurnOffMonitor.rar
I placed some spaces since i cant make a link yet so yea Enjoy.
Code
#include <Windows.h>
int main()
{
//turns off Monitor
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)2);
Sleep(5000); // the Monitor is turned off for 5 seconds
//(Down) This line off code turns the monitor Back on.
SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM)-1);
return 0;
// Returning 0 shuts off the application, so to run it again you would have to start it again.
}Well looks like i made a mistake, if u have Visual Studio 2015 or probably any VS start it and you will see the effects.

