News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

how to blank the screen

Started by erkki, March 20, 2006, 12:35:33 AM

Previous topic - Next topic

erkki

nope. the "green" (power saving?) features work ok - low power lcd, monitor off etc. i have the blank screen ("green", not black) screensaver. my problem is a generic one: screensavers and SC_MONITORPOWER unblank on user activity, whereas I WANT TO WRITE WITH MONITOR OFF, which seems to be impossible

do you think this problem could be approached with int 10h? pardon if it's a stupid suggestion, i'm new to masm32

Mark Jones

Aaah I see what you're saying. Guess it's a matter of how Windows powers up the monitor on keypress then - maybe globally hook the keyboard and force it to bypass all windows callback messages? If that is even possible, I'm not certain. :wink
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

erkki

this would be one (but perhaps hopelessly complicated) way to work around the problem, yes

other ideas i have are:

- int 10h (which is more a flashback from 16-bit days than a solid idea) and

- finding a way to trick the system thinking that it is connected to an external monitor. this would make the lcd/crt switch key work, and the switch key could then be used to turn lcd on/off. by default the lcd/crt switch works only when the computer is connected to an external monitor

P1

Create a new black desktop and let everything run on the old until to switch from or destroy the new desktop.

Regards,  P1  :8)

erkki

yes, well, this would still be a black desktop - a solution i've already tried and discarded (see above) - not the lcd power off i want

P1

Quote from: erkki on March 22, 2006, 12:22:08 AM
yes, well, this would still be a black desktop - a solution i've already tried and discarded (see above) - not the lcd power off i want
Seek manufacturer's help.

Regards,  P1   :8)

elmo

the following code will turn off the monitor directly
         invoke SendMessage, hWin,WM_SYSCOMMAND,SC_MONITORPOWER,2   ;MONITOR_OFF

but I want to do it gradually.
So, What I want is:  I want to change monitor brightness or contrast.
but how?
would you like to give me a clue?
Thank you.
sorry for my bad english
be the king of accounting programmer world!

Tedd

It's not wise to fiddle with a user's settings, but it's not necessary.

Copy the contents of the screen to a memory bitmap, create a fullscreen window (make it 'on-top'), bitblt the bitmap to your window, then fade your bitmap, pause, copy to screen, repeat until black. And then put the screen into power-save mode, and destroy your window.
No snowflake in an avalanche feels responsible.

Magnum

Thanks Tedd.

I found your program to be very useful.



Have a great day,
                         Andy

dedndave

a while back, the guys were having fun doing something similar
you will get a chuckle out of this stuff - and the code may be along the lines of what you want
there are a few examples in this thread
http://www.masm32.com/board/index.php?topic=2172.msg17208#msg17208
and one here by Erol
http://www.masm32.com/board/index.php?topic=13318.msg103634#msg103634