topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 9:04 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Last post Author Topic: idea: Application to turn off a laptop's display.  (Read 31882 times)

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
idea: Application to turn off a laptop's display.
« on: January 16, 2008, 12:38 PM »
Hello all,
I don't think I've posted here in the past, so I'd like to say hey to everyone. now on to my request. As a blind user, I don't really have any use for my laptop's monitor. I'd appreciate it if someone could point me to a program that I can use to turn on and off my laptop's display. thanks for any help!

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #1 on: January 16, 2008, 03:21 PM »
Hi. I tried coding it, the monitor can be shut down using
       invoke SendMessage, HWND_BROADCAST, WM_SYSCOMMAND, 6180   , 2
but surprise, it turns on after the slightest mouse or keyboard movement.

I personally doubt it can be done via software, however, a low-tech workaround might work. Set windows to NOT to suspend the laptop when closing the lid. On my laptop at least, where monitor meets the keyboard, there's a small button. Simply stick something there and the monitor will turn off, but keyboard and touchpad will still work as normal. Hope it helps.

I attached a video as proof, using a business card.

[flash=240,180]http://scancode.dcmembers.com/files/player.swf?file=laptop.flv&size=false&aplay=false&autorew=false&title=[/flash]
http://scancode.dcme...com/files/laptop.flv

Best regards.
« Last Edit: January 16, 2008, 03:26 PM by scancode »

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #2 on: January 16, 2008, 04:07 PM »
Hello,
thanks for your reply. Unfortunately my display does not have any buttons, so that will not work. If anyone else comes up with anything please let me know. thanks all!

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #3 on: January 16, 2008, 04:34 PM »
What make/model is your laptop, musicman?

Do you just want it off in order to save power?  When would you want it turned on?

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #4 on: January 16, 2008, 05:03 PM »
Hello suleika,
My laptop is a Toshiba, and for the model it says Satellite A205. THe main reason I want to disable the display is that I'm blind and don't need it, unless someone sighted is using it. I also figure that with the display off the battery will last a bit longer. I'm not sure how long I'll have the display off, so a hotkey to turn it on or off would be useful. thanks for replying!

housetier

  • Charter Honorary Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 1,321
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #5 on: January 16, 2008, 05:43 PM »
I am sure turning off the display will make the battery last longer.

I couldn't find the Satellite 205 on toshiba-europe.com nor in the online shop from which my boss buys all the gear we use and sell.

Usually, there is a tiny switch near the "fold". This switch is pressed down by the lid's frame when it is closed. On most operating systems this should also send a signal to put the hardware in standby or suspend mode to save energy. In your case, we first need to find this tiny plastic lever, and then keep the operating system running normally when it is pressed.

suleika

  • Supporting Member
  • Joined in 2007
  • **
  • Posts: 117
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #6 on: January 16, 2008, 05:51 PM »
If you could fool your laptop into thinking it was attached to an external monitor, you might be able to direct your display to that monitor.  I suppose it might work without even attaching the external monitor.  I think on your laptop the toggle is Fn+F5.

Going back to scancode's suggestion, your laptop must have some kind of cue to tell it that the lid is closed.  Perhaps it is some other kind of sensor rather than a button?  The idea would be to fool the laptop into thinking the lid is closed.  To tell you the truth, I can't find the sensor or button on my laptop, so I suppose these things might be hard to find.  And so I can't test it either.  But it sounds like a neat trick....

On preview, housetier mentioned the tiny switch near the "fold".  That's the kind of thing you're looking for.

Here are some userguides.

jgpaiva

  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 4,727
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #7 on: January 16, 2008, 08:07 PM »
Suleika just gave me the perfect idea:
Most laptops have a key for turning off the monitor! It should be in the fn+F-something range. (in my acer, it's fn+F6).

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #8 on: January 18, 2008, 05:49 AM »
I might be able to do this.

I just need to know what hotkey combos you would like to use to turn the monitor off and back on. They have to be something that wouldn't be used by another application for anything.
« Last Edit: January 18, 2008, 05:51 AM by app103 »

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #9 on: January 18, 2008, 07:36 AM »
Thanks all for your input. Unfortunately the FN keys do not turn off the monitor. F-6 and F-7 adjust the brightness, but that's all. App, I really dont' mind which hotkey you use. In fact I just used hotkeys as an example. it could be a button, or checkbox. Thanks for your help!

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #10 on: January 18, 2008, 07:47 AM »
Well, I have it almost finished and it just needs 2 lines of code and a set of hotkeys. (then I have to test it)

I am never really good with picking hotkeys that make sense and don't conflict with other things, so maybe someone else here can make a suggestion for the 2 combos that I should use this?

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #11 on: January 18, 2008, 07:50 AM »
Well, I have it almost finished and it just needs 2 lines of code and a set of hotkeys. (then I have to test it)

I am never really good with picking hotkeys that make sense and don't conflict with other things, so maybe someone else here can make a suggestion for the 2 combos that I should use this?
Win-Z
Win-X

Good one-finger combos :)

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #12 on: January 18, 2008, 08:17 AM »
actually win-x is used for windows mobility center. how about win-a and win-s? Those are free. It could also be a button on the system tray.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #13 on: January 18, 2008, 08:30 AM »
This will be a tray icon with a menu, but I also want to use a set of hotkeys.

I can't use the win key so pick something else.

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #14 on: January 18, 2008, 08:39 AM »
How about control+alt+I for enable, control+alt+D for disable?

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #15 on: January 18, 2008, 10:43 AM »
After testing, I have bad news. I can't get the monitor to shut off and stay off. As soon as any input or mouse movement is detected it comes right back on.

About the only thing that might work would be to close the lid and use an external keyboard.

I am sorry I couldn't help.


Wisdom for Coders: Never use code to turn off the monitor and use a timer to execute it repeatedly to keep it off...you won't be able to use the hotkey to turn it back on (and shut the timer off) or use your pc for anything, without hitting the reset button.  :-[

You can all stop laughing now.

jazper

  • Coding Snacks Author
  • Charter Honorary Member
  • Joined in 2005
  • ***
  • Posts: 92
    • View Profile
    • Jazper's Software
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #16 on: January 18, 2008, 10:55 AM »
What if you hooked the API that turns the monitor back on, and only allow it on when the hotkey is invoked.






scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #17 on: January 18, 2008, 11:58 AM »

Wisdom for Coders: Never use code to turn off the monitor and use a timer to execute it repeatedly to keep it off...you won't be able to use the hotkey to turn it back on (and shut the timer off) or use your pc for anything, without hitting the reset button.  :-[


Too late. I did it in ASM. On the first post.
      @@:
          invoke SendMessage, HWND_BROADCAST, WM_SYSCOMMAND, 61808   , 2
         invoke Sleep, 1
          jmp @b

That was all the code I compiled. After running, the monitor turned off, and everytime i moved the mouse or pressed a key it turned flashed on and back off. Half-blind, I went to start/run and tskilled my app
:)

Edit: typonese
« Last Edit: January 18, 2008, 12:02 PM by scancode »

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #18 on: January 18, 2008, 12:16 PM »
What if you hooked the API that turns the monitor back on, and only allow it on when the hotkey is invoked.

If anyone knows a way to do it, you are welcome to try. I gave up.


That was all the code I compiled. After running, the monitor turned off, and everytime i moved the mouse or pressed a key it turned flashed on and back off. Half-blind, I went to start/run and tskilled my app
:)

Mine was running in my Delphi IDE, and I had notepad as the window with focus to test input ability while monitor was off. No input ability at all with my code, so I couldn't kill my app.

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #19 on: January 18, 2008, 12:23 PM »
Mine was running in my Delphi IDE, and I had notepad as the window with focus to test input ability while monitor was off. No input ability at all with my code, so I couldn't kill my app.

Fsck, that sucks. It reminds me when I wrote a keyboard hook... complete keyboard disabled... no fun at all ;)

tsaint

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 497
  • Hi from the a*** end of the earth
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #20 on: January 18, 2008, 05:49 PM »
On satellites, I think f5 is the function key for changing display to external monitors musicman.

Thanks all for your input. Unfortunately the FN keys do not turn off the monitor. F-6 and F-7 adjust the brightness, but that's all. App, I really dont' mind which hotkey you use. In fact I just used hotkeys as an example. it could be a button, or checkbox. Thanks for your help!

patthecat

  • Member
  • Joined in 2006
  • **
  • Posts: 88
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #21 on: January 18, 2008, 08:33 PM »
Another option is a utility called "PowerOff" (see link below) whose primary purpose is to power off, shutdown or reboot your pc, log you off, lock your workstation, go to standby or hibernation mode and even wake up another pc via Wake On Lan.  It can even run via the command line.  I've been using it in a batch file run via task scheduler to shut down my niece&nephew's computer when it has been inactive for a certain amount of time.

The reason I mention it is that it also has the feature to turn the monitor OFF or ON.  So with the capability to run on command line / batch file, maybe someone can map it to a hotkey or like I have done put it in task scheduler.

http://users.pandora...oweroff/poweroff.htm

patrick


app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #22 on: January 18, 2008, 09:17 PM »
Another option is a utility called "PowerOff"

This will not work either.

3.2.7 Turn off monitor
This action will put monitor in standby (powersaving) mode. You need a monitor that is capable of this feature.

3.2.7 Turn on monitor
This action will turn on power to your monitor (get it out of stanby/powersaving mode). You need a monitor that is capable of this feature.

It is using the same API calls that we have already tried.

I'll tell you why this will not work.

It should run on Windows 95/98/Me/NT4.0/2000/XP

If he were running Windows 95 it would work. Windows 95 required code to both turn off and turn on the monitor. If you turned it off it would stay off till you made the call to turn it back on. But only Windows 95 works this way.

Power management in other Windows versions will automatically wake the monitor when mouse movement or keyboard activity is detected.

So if he were to use this application, it would behave the same as any attempt the rest of us has made when trying to make a tool to turn it off, because he isn't running Windows 95.

I guess Microsoft saw it as a poor decision to require both calls in Win95, and maybe there was a problem with prank programs turning off people's monitors and requiring a reboot to get them back on again. At some point during the development of their next OS, Microsoft decided there would never be a reason why you would want to type and move your mouse and still have your monitor off.

I guess they don't have any blind coders on laptops, without monitor power buttons, working for them.

app103

  • That scary taskbar girl
  • Global Moderator
  • Joined in 2006
  • *****
  • Posts: 5,884
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #23 on: January 18, 2008, 09:24 PM »
The manual for his A205 says:

Fn+F5 switches between monitor output modes

and there are like 10 different ones it is stepping through with internal, external, tv out, and combos of those.

Got this info from another programmer while seeking answers to this problem:

Setting the power management profile to maximum battery lifetime gets you much more additional battery time than turning off the backlight.

c't (a rather good german computer mag) benchmarks battery life when testing notebooks and the last tests didn't show a big difference between backlight on and off.


Edited to link to manual.
« Last Edit: January 18, 2008, 09:36 PM by app103 »

musicman

  • Supporting Member
  • Joined in 2007
  • **
  • default avatar
  • Posts: 9
    • View Profile
    • Donate to Member
Re: idea: Application to turn off a laptop's display.
« Reply #24 on: January 18, 2008, 10:15 PM »
Thanks for trying to help guys. Really appreciate it. However it seems impossible to turn off the monitor and keep it off till I decide to turn it back on. Do any of you know other sites I could ask for help?