Re: Dim the laptop screen.
Is there a particular reason you want to use code?
You can set it via Control Panel (under "Power Options" I think).
Re: Dim the laptop screen.
Quote:
Originally Posted by si_the_geek
Is there a particular reason you want to use code?
You can set it via Control Panel (under "Power Options" I think).
I've looked there, there's only an option to turn off the monitor after x minutes.
I would like to be able to toggle the dimming of the screen.
Re: Dim the laptop screen.
I don't know about you, but my laptop came with hot keys to control that .... what you need to do is set the brightness when it's plugged in... when it becomes unplugged, it'll switch to the "dim" mode... when you plug it back it, it should remember the dimness setting from the last time it was plugged in and restore it.
-tg
Re: Dim the laptop screen.
Quote:
Originally Posted by techgnome
I don't know about you, but my laptop came with hot keys to control that .... what you need to do is set the brightness when it's plugged in... when it becomes unplugged, it'll switch to the "dim" mode... when you plug it back it, it should remember the dimness setting from the last time it was plugged in and restore it.
-tg
I hadn't thought of that one, there are function keys for setting the screen brightness.
Thanks for the help!
I'm leaving this open for now, it still could be handy to have code for doing it.
Re: Dim the laptop screen.
You can do it using sendmessage. here is an example
something like this... needs little bit of tweaking. this code puts the monitor off...
Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, _
lParam As Any) As Long
Private Const SC_MONITORPOWER = &HF170&
Private Const WM_SYSCOMMAND = &H112
Private Sub Command1_Click()
Call SendMessage(Me.hWnd, WM_SYSCOMMAND, SC_MONITORPOWER, ByVal 2&)
End Sub
Re: Dim the laptop screen.