[python-win32] Issue with monitor off

Tim Roberts timr at probo.com
Thu Jun 10 12:35:42 EDT 2021


anteqqq1 wrote:
> Hello there, I have a question concerning Win32 usage. The idea is 
> that after operations in python i want to turn my monitor off but when 
> i use Win32 command win32gui.SendMessage(win 32con.HWND_BROADCAST, 
> win32con.WM_SYSCOMMAND, win32con.SC_MONITORPOWER , 2) the monitor not 
> only goin off state but the machine is also going sleep mode . My 
> question is : Is there any way to prevent machine going to sleep ? The 
> only thing i need is to turn monitor off :)

The operating system can do this for you automatically, in the "Power & 
Sleep" control panel page.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3389 bytes
Desc: S/MIME Cryptographic Signature
URL: <https://mail.python.org/pipermail/python-win32/attachments/20210610/4aa5ec4d/attachment.bin>


More information about the python-win32 mailing list