turn monitor off and on

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Mon May 16 05:29:00 EDT 2011


En Sat, 14 May 2011 03:08:44 -0300, Astan Chee <astan.chee at 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




More information about the Python-list mailing list