Welcome Guest.   Make a donation to an author on the site September 18, 2014, 08:48:00 PM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
The N.A.N.Y. Challenge 2012! Download dozens of custom programs!
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1] 2 Next   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: idea: Application to turn off a laptop's display.  (Read 15512 times)
musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« on: January 16, 2008, 12:38:13 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!
Logged
scancode
Honorary Member
**
Posts: 636



I will eat Cody someday.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: January 16, 2008, 03:21:49 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.dcmembers.com/files/laptop.flv

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

musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #2 on: January 16, 2008, 04:07:34 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!
Logged
suleika
Supporting Member
**
Posts: 117


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: January 16, 2008, 04:34:13 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?
Logged
musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #4 on: January 16, 2008, 05:03:25 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!
Logged
housetier
Charter Honorary Member
***
Posts: 1,321


see users location on a map View Profile Give some DonationCredits to this forum member
« Reply #5 on: January 16, 2008, 05:43:22 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.
Logged
suleika
Supporting Member
**
Posts: 117


see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #6 on: January 16, 2008, 05:51:27 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.
Logged
jgpaiva
Global Moderator
*****
Posts: 4,710



Artificial Idiocy

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #7 on: January 16, 2008, 08:07:02 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).
Logged

app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #8 on: January 18, 2008, 05:49:36 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:54 AM by app103 » Logged

musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #9 on: January 18, 2008, 07:36:32 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!
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #10 on: January 18, 2008, 07:47:00 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?
Logged

scancode
Honorary Member
**
Posts: 636



I will eat Cody someday.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #11 on: January 18, 2008, 07:50:03 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 smiley
Logged

musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #12 on: January 18, 2008, 08:17:02 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.
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #13 on: January 18, 2008, 08:30:16 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.
Logged

musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #14 on: January 18, 2008, 08:39:26 AM »

How about control+alt+I for enable, control+alt+D for disable?
Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #15 on: January 18, 2008, 10:43:57 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.  embarassed

You can all stop laughing now.
Logged

jazper
Coding Snacks Author
Charter Honorary Member
***
Posts: 92



View Profile WWW Give some DonationCredits to this forum member
« Reply #16 on: January 18, 2008, 10:55:23 AM »

What if you hooked the API that turns the monitor back on, and only allow it on when the hotkey is invoked.





Logged
scancode
Honorary Member
**
Posts: 636



I will eat Cody someday.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #17 on: January 18, 2008, 11:58:04 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.  embarassed


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
smiley

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

app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #18 on: January 18, 2008, 12:16:15 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
smiley

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.
Logged

scancode
Honorary Member
**
Posts: 636



I will eat Cody someday.

see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #19 on: January 18, 2008, 12:23:24 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 Wink
Logged

tsaint
Charter Member
***
Posts: 429


Hi from the a*** end of the earth

see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #20 on: January 18, 2008, 05:49:16 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!
Logged
patthecat
Member
**
Posts: 88


View Profile Give some DonationCredits to this forum member
« Reply #21 on: January 18, 2008, 08:33:40 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.be/j...man/poweroff/poweroff.htm

patrick

Logged
app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #22 on: January 18, 2008, 09:17:56 PM »

Another option is a utility called "PowerOff"

This will not work either.

Quote
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.

Quote
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.
Logged

app103
That scary taskbar girl
Global Moderator
*****
Posts: 5,209



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #23 on: January 18, 2008, 09:24:59 PM »

The manual for his A205 says:

Quote
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:

Quote
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:48 PM by app103 » Logged

musicman
Supporting Member
**
Posts: 9

View Profile Give some DonationCredits to this forum member
« Reply #24 on: January 18, 2008, 10:15:09 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?
Logged
Pages: [1] 2 Next   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.049s | Server load: 0.11 ]