Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5505

Re: turn monitor off and on

From "Gabriel Genellina" <gagsl-py2@yahoo.com.ar>
Subject Re: turn monitor off and on
Date 2011-05-16 06:29 -0300
References <BANLkTik8Ckt-MQ6mvDYbk9zVc3Gy1iYVnw@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1637.1305538167.9059.python-list@python.org> (permalink)

Show all headers | View raw


En Sat, 14 May 2011 03:08:44 -0300, Astan Chee <astan.chee@gmail.com>  
escribió:

> I'm trying to turn off my monitor, pause and then turn it on again.
> I'm doing this in python 2.6 and windows xp. Here is my script so far
> (that doesn't work):
>
> def turnOnMonitor():
>   SC_MONITORPOWER = 0xF170
>   win32gui.SendMessage(win32con.HWND_BROADCAST,
> win32con.WM_SYSCOMMAND, SC_MONITORPOWER, -1)
>
> For some reason, the script doesn't turn the monitor back on. What am
> I doing wrong here or are there any other alternative?

Your script worked fine for me, 2.6 and XP also. Perhaps your monitor  
device driver is buggy or does not implement the required functionality.  
Mine is from Philips.

-- 
Gabriel Genellina

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: turn monitor off and on "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> - 2011-05-16 06:29 -0300

csiph-web