Turns monitor off then back on..

Discussion in 'Programming General' started by d3hydrate, Jan 24, 2009.

Turns monitor off then back on..
  1. Unread #1 - Jan 24, 2009 at 3:29 PM
  2. d3hydrate
    Joined:
    Jan 24, 2009
    Posts:
    6
    Referrals:
    0
    Sythe Gold:
    0

    d3hydrate Newcomer

    Turns monitor off then back on..

    /***************************************
    * Turns monitor off then back on..
    * Working on implementing this remotely
    *
    ****************************************/
    #include <windows.h>
    #include <ctime>

    int main()
    {

    int seconds = 10; //Change time delay here
    clock_t delay = seconds *CLOCKS_PER_SEC;
    clock_t start = clock();
    while(clock() - start < delay){
    SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);}
    SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
    return 0;
    }
     
< [Tut] File Download -- My NameSpace | RS private server help. >

Users viewing this thread
1 guest


 
 
Adblock breaks this site