Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python': 0.07; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'monitor': 0.12; 'def': 0.13; '-1)': 0.16; 'from:addr:yahoo.com.ar': 0.16; 'pause': 0.16; 'fine': 0.18; 'device': 0.20; 'trying': 0.23; 'driver': 0.23; 'reason,': 0.23; 'worked': 0.24; 'mine': 0.25; 'script': 0.26; 'windows': 0.26; "i'm": 0.26; "doesn't": 0.28; 'sat,': 0.29; 'implement': 0.30; 'charset:iso-8859-15': 0.31; 'also.': 0.31; 'does': 0.31; 'perhaps': 0.32; 'to:addr:python- list': 0.32; 'header:X-Complaints-To:1': 0.34; 'there': 0.35; 'header:User-Agent:1': 0.35; '2.6': 0.35; 'doing': 0.36; 'some': 0.37; 'received:org': 0.38; 'to:addr:python.org': 0.39; 'header :Mime-Version:1': 0.39; 'header:Received:5': 0.40; 'back': 0.61; '2011': 0.62; 'here': 0.65; 'subject:off': 0.73; '-0300,': 0.84; 'genellina': 0.84; 'gabriel': 0.91; 'received:186': 0.91 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: "Gabriel Genellina" Subject: Re: turn monitor off and on Date: Mon, 16 May 2011 06:29:00 -0300 References: Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15; format=flowed; delsp=yes Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: 186.19.171.200 User-Agent: Opera Mail/11.01 (Win32) X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 22 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1305538168 news.xs4all.nl 81476 [::ffff:82.94.164.166]:51356 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:5505 En Sat, 14 May 2011 03:08:44 -0300, Astan Chee 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