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

i'm looking for a way to blank the screen with masm32. the reason a screensaver wont do is that i dont want the screen to unblank on every mouse/keyb activity. any suggestions?

hutch--

Dreate a maximised window with no titlebar or border and fill it with whatever bckground colour you want. It is in fact a very simple task.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

erkki

pardon my inaccuracy. the problem is not in filling it with any color, but in turning the screen lighting / monitor off :boohoo:

jckl

Have a look at this page.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/keyboardaccelerators/keyboardacceleratorreference/keyboardacceleratormessages/wm_syscommand.asp

You can use SendMessage with WM_SYSCOMMAND and SC_MONITORPOWER

This line below will shut off your screen..

Invoke SendMessage, HWND_BROADCAST, WM_SYSCOMMAND, SC_MONITORPOWER, 2

erkki

thnx, jckl. i'll get cracking  :U

Tedd

There should be a button on the monitor, try pressing it, I believe it will turn off the whole screen :cheekygreen:

{The SC_MONITORPOWER function will still allow reactivation of the screen when a keyboard/mouse event is detected.}


[attachment deleted by admin]
No snowflake in an avalanche feels responsible.

erkki


erkki

if i get it right, there's no standard way to do it with monitorpower (or maybe only a very complicated one), and maybe no standard programmatic way at all. so unless someone has other ideas, i'm back to sq 1

Mark Jones

Hello Erkki, check this out: http://www.masmforum.com/simple/index.php?topic=1897.0

Found it by typing "monitor standby" in the search box above. Good luck.
"To deny our impulses... foolish; to revel in them, chaos." MCJ 2003.08

ChrisLeslie

What is wrong with Hutch's suggestion - with black!. Then you have an easy programed control of blanking/unblanking. Keep it simple.

Chris  :wink

MichaelW

Quote from: erkki on March 20, 2006, 10:39:04 PM
in fact there isn't.

There is no power button on the monitor? Could it be that the power button is not accessible because you are trying to control someone else's monitor, in an effort to hide your activities?

eschew obfuscation

erkki

Mark Jones - the thread you found is on SC_MONITORPOWER, which is of no use for me, as it unblanks on keyb/mouse activity automatically (whereas i would want a custom unblank on, say, Esc only)

ChrisLeslie - i agree that black would be simpler, but black and poweoff/standby/low power have visible difference (on my lcd at least). with black the screen is still illuminated by backlighting, on the others not

MichaelW - i have a new laptop model with no monitor switch (only lcd/crt switch, which unfortunately doesnt work if i'm not connected to an external monitor. if it worked i'd happily use this lcd/crt to unblank my screen)

jckl

If you dont mind me asking may i know the reasons at which you need to make the screen non visable to the point where you do not want it to be reinstated on key press or mouse move?

erkki

jckl - my work requires me to write a lot, and i'm used to blind typing

P1

I have seen where you need to have the Monitor Manufacturer's inf loaded, before you can get the "Green" features to work, if they are there in the first place.  If Monitor is not "Green", then Black blanking is all you got.  Some ( dumb ) monitors have power save function that are not controlled by software, but monitoring the VGA inputs.

Time to buy a new LCD flat panel with "Green" features???

Regards,  P1  :8)