[python-win32] Changing desktop color (Chris Stromberger)

Gabriel Genellina gagenellina at softlab.com.ar
Wed Feb 9 02:57:20 CET 2005


At Tuesday 8/2/2005 08:00, python-win32-request at python.org wrote:

>How can I change the desktop color?  I want to set it to black.  Can
>be just for the current session.

SetSysColors: 
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/sysinfo/base/setsyscolors.asp>

Ouch, unfortunately that function isn't available thru win32all
Using ctypes:

<code>
from ctypes.wintypes import windll, c_int, byref, RGB
COLOR_BACKGROUND = 1 # from winuser.h or win32con
SetSysColors = windll.user32.SetSysColors
which_color = RGB(255,0,0) # red
SetSysColors(1, byref(c_int(COLOR_BACKGROUND)), byref(c_int(which_color)))
</code>


Gabriel Genellina
Softlab SRL  



More information about the Python-win32 mailing list