Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Turn Monitor Off  (Read 12573 times)

0 Members and 1 Guest are viewing this topic.

Carbon Dudeoxide

    Topic Starter
  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Turn Monitor Off
« on: April 14, 2009, 10:19:26 AM »
With a little help from RalphSpencer, I have created a small application in C++ that will turn off your computer's monitor.

To wake it up, simply move your mouse or press a key on your keyboard.

C++ Source Code:
Code: [Select]
#include <windows.h>
int main(void)
{
 SendMessage(HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, (LPARAM) 2);
 return 0;
  }

I made this so that I can save power on my laptop when not using it at school.
Hopefully this will benefit others.

I haven't experienced any bugs with it, but if any of you notice something strange, please let me know.


Application is attached to this post, but here is a mirror:
http://www.fileupyours.com/files/191176/Monitor%20Off.zip

[attachment deleted by admin]

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: Turn Monitor Off
« Reply #1 on: April 14, 2009, 10:40:58 AM »
We will not be your beta testers!  We defy you!!   ;)

That's pretty cool, actually.


"For you, a thousand times over." - "The Kite Runner"

Carbon Dudeoxide

    Topic Starter
  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: Turn Monitor Off
« Reply #2 on: April 14, 2009, 10:53:13 AM »
Lol. I don't consider it a beta. It's too simple to be a beta. :P

Thanks. ;)

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Turn Monitor Off
« Reply #3 on: April 14, 2009, 11:35:24 AM »
Alpha ? ?
" Anyone who goes to a psychiatrist should have his head examined. "

Carbon Dudeoxide

    Topic Starter
  • Global Moderator

  • Mastermind
  • Thanked: 169
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Experience: Guru
  • OS: Mac OS
Re: Turn Monitor Off
« Reply #4 on: April 14, 2009, 11:40:37 AM »
And Gamma.

Three types of Radiation.

And besides that diversion, I wouldn't upload anything here unless it was finished and doing what it was supposed to. ;)

soybean



    Genius
  • The first soybean ever to learn the computer.
  • Thanked: 469
  • Computer: Specs
  • Experience: Experienced
  • OS: Windows 10
Re: Turn Monitor Off
« Reply #5 on: April 14, 2009, 11:46:51 AM »
Installation instructions?

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Turn Monitor Off
« Reply #6 on: April 14, 2009, 12:47:56 PM »
1.copy somewhere.

2.run it.

 ;D

if you call PostMessage instead it won't hang if one of the running programs is hung as well- either that or SendMessageTimeout. See- always room for improvement.

I was trying to dereference Null Pointers before it was cool.

kpac

  • Web moderator


  • Hacker

  • kpac®
  • Thanked: 184
    • Yes
    • Yes
    • Yes
  • Certifications: List
  • Computer: Specs
  • Experience: Expert
  • OS: Windows 7
Re: Turn Monitor Off
« Reply #7 on: April 14, 2009, 12:49:13 PM »
Name and address, please, just incase it messes up my laptop..... ;D

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Turn Monitor Off
« Reply #8 on: April 14, 2009, 12:52:38 PM »
what's it going to do?

it broadcasts a message the computer sends anyway when it shuts the monitor off...
I was trying to dereference Null Pointers before it was cool.

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: Turn Monitor Off
« Reply #9 on: April 14, 2009, 01:01:22 PM »
Quote
it broadcasts a message the computer sends anyway when it shuts the monitor off...


So, like, what?  Carbon's not as slick as he thinks he is?   ;)

(Just teasing -- I wouldn't have known how to write that.)


"For you, a thousand times over." - "The Kite Runner"

BC_Programmer


    Mastermind
  • Typing is no substitute for thinking.
  • Thanked: 1140
    • Yes
    • Yes
    • BC-Programming.com
  • Certifications: List
  • Computer: Specs
  • Experience: Beginner
  • OS: Windows 11
Re: Turn Monitor Off
« Reply #10 on: April 14, 2009, 01:02:51 PM »
no, that was in response to kpac, although I guess the ;D means he was joking.

As in, how could it mess up a computer...



I'd post a VB version but it would be longer and really just an attempt to draw attention to myself.
I was trying to dereference Null Pointers before it was cool.

Aegis



    Expert

    Thanked: 67
    • Yes
    • Yes
    • Brian's Mess Of A Web Page
  • Experience: Experienced
  • OS: Windows 10
Re: Turn Monitor Off
« Reply #11 on: April 14, 2009, 01:04:35 PM »
Quote
I'd post a VB version but it would be longer and really just an attempt to draw attention to myself.


OK, Al...   ;D

Don't "inconvenience" us, or anything...
 

 


"For you, a thousand times over." - "The Kite Runner"

Helpmeh



    Guru

  • Roar.
  • Thanked: 123
    • Yes
    • Yes
  • Computer: Specs
  • Experience: Familiar
  • OS: Windows 8
Re: Turn Monitor Off
« Reply #12 on: April 14, 2009, 06:39:54 PM »
Just saying, it does work...very cool... 8) 8) 8)
Where's MagicSpeed?
Quote from: 'matt'
He's playing a game called IRL. Great graphics, *censored* gameplay.

patio

  • Moderator


  • Genius
  • Maud' Dib
  • Thanked: 1769
    • Yes
  • Experience: Beginner
  • OS: Windows 7
Re: Turn Monitor Off
« Reply #13 on: April 14, 2009, 08:53:35 PM »
no, that was in response to kpac, although I guess the ;D means he was joking.

As in, how could it mess up a computer...



I'd post a VB version but it would be longer and really just an attempt to draw attention to myself.

You know what they say...pictures...or it didn't happen.
" Anyone who goes to a psychiatrist should have his head examined. "

Biker



    Rookie

    • Experience: Expert
    • OS: Windows 7
    Re: Turn Monitor Off
    « Reply #14 on: April 23, 2009, 07:15:26 PM »
    my Logitech LX 700 already does that, called Sleep Mode

    Aegis



      Expert

      Thanked: 67
      • Yes
      • Yes
      • Brian's Mess Of A Web Page
    • Experience: Experienced
    • OS: Windows 10
    Re: Turn Monitor Off
    « Reply #15 on: April 23, 2009, 08:01:28 PM »
    I go into sleep mode, quite often, myself..  :P


    "For you, a thousand times over." - "The Kite Runner"

    Kurtiskain



      Mentor

      Thanked: 58
      • Yes
      • Yes
      • Yes
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Turn Monitor Off
    « Reply #16 on: May 02, 2009, 03:32:46 AM »
    love the icon  ;D