win32gui.SystemParametersInfo

SystemParametersInfo(Action, Param, WinIni)

Queries or sets system-wide parameters. This function can also update the user profile while setting a parameter.

Parameters

Action : int

System parameter to query or set, one of the SPI_GET* or SPI_SET* constants

Param=None : object

depends on action to be taken

WinIni=0 : int

Flags specifying whether change should be permanent, and if all windows should be notified of change. Combination of SPIF_UPDATEINIFILE, SPIF_SENDCHANGE, SPIF_SENDWININICHANGE

Action Input/return type


SPI_GETDESKWALLPAPERReturns the path to the bmp used as wallpaper
SPI_SETDESKWALLPAPERParam should be a string specifying a .bmp file
SPI_GETDROPSHADOWReturns a boolean
SPI_GETFLATMENUReturns a boolean
SPI_GETFONTSMOOTHINGReturns a boolean
SPI_GETICONTITLEWRAPReturns a boolean
SPI_GETSNAPTODEFBUTTONReturns a boolean
SPI_GETBEEPReturns a boolean
SPI_GETBLOCKSENDINPUTRESETSReturns a boolean
SPI_GETMENUUNDERLINESReturns a boolean
SPI_GETKEYBOARDCUESReturns a boolean
SPI_GETKEYBOARDPREFReturns a boolean
SPI_GETSCREENSAVEACTIVEReturns a boolean
SPI_GETSCREENSAVERRUNNINGReturns a boolean
SPI_GETMENUDROPALIGNMENTReturns a boolean (True indicates left aligned, False right aligned)
SPI_GETMENUFADEReturns a boolean
SPI_GETLOWPOWERACTIVEReturns a boolean
SPI_GETPOWEROFFACTIVEReturns a boolean
SPI_GETCOMBOBOXANIMATIONReturns a boolean
SPI_GETCURSORSHADOWReturns a boolean
SPI_GETGRADIENTCAPTIONSReturns a boolean
SPI_GETHOTTRACKINGReturns a boolean
SPI_GETLISTBOXSMOOTHSCROLLINGReturns a boolean
SPI_GETMENUANIMATIONReturns a boolean
SPI_GETSELECTIONFADEReturns a boolean
SPI_GETTOOLTIPANIMATIONReturns a boolean
SPI_GETTOOLTIPFADEReturns a boolean (TRUE=fade, False=slide)
SPI_GETUIEFFECTSReturns a boolean
SPI_GETACTIVEWINDOWTRACKINGReturns a boolean
SPI_GETACTIVEWNDTRKZORDERReturns a boolean
SPI_GETDRAGFULLWINDOWSReturns a boolean
SPI_GETSHOWIMEUIReturns a boolean
SPI_GETMOUSECLICKLOCKReturns a boolean
SPI_GETMOUSESONARReturns a boolean
SPI_GETMOUSEVANISHReturns a boolean
SPI_GETSCREENREADERReturns a boolean
SPI_GETSHOWSOUNDSReturns a boolean
SPI_SETDROPSHADOWParam must be a boolean
SPI_SETDROPSHADOWParam must be a boolean
SPI_SETMENUUNDERLINESParam must be a boolean
SPI_SETKEYBOARDCUESParam must be a boolean
SPI_SETMENUFADEParam must be a boolean
SPI_SETCOMBOBOXANIMATIONParam must be a boolean
SPI_SETCURSORSHADOWParam must be a boolean
SPI_SETGRADIENTCAPTIONSParam must be a boolean
SPI_SETHOTTRACKINGParam must be a boolean
SPI_SETLISTBOXSMOOTHSCROLLINGParam must be a boolean
SPI_SETMENUANIMATIONParam must be a boolean
SPI_SETSELECTIONFADEParam must be a boolean
SPI_SETTOOLTIPANIMATIONParam must be a boolean
SPI_SETTOOLTIPFADEParam must be a boolean
SPI_SETUIEFFECTSParam must be a boolean
SPI_SETACTIVEWINDOWTRACKINGParam must be a boolean
SPI_SETACTIVEWNDTRKZORDERParam must be a boolean
SPI_SETMOUSESONARParam must be a boolean
SPI_SETMOUSEVANISHParam must be a boolean
SPI_SETMOUSECLICKLOCKParam must be a boolean
SPI_SETFONTSMOOTHINGParam should specify a boolean
SPI_SETICONTITLEWRAPParam should specify a boolean
SPI_SETSNAPTODEFBUTTONParam is a boolean
SPI_SETBEEPParam is a boolean
SPI_SETBLOCKSENDINPUTRESETSParam is a boolean
SPI_SETKEYBOARDPREFParam is a boolean
SPI_SETMOUSEBUTTONSWAPParam is a boolean
SPI_SETSCREENSAVEACTIVEParam is a boolean
SPI_SETMENUDROPALIGNMENTParam is a boolean (True=left aligned, False=right aligned)
SPI_SETLOWPOWERACTIVEParam is a boolean
SPI_SETPOWEROFFACTIVEParam is a boolean
SPI_SETDRAGFULLWINDOWSParam is a boolean
SPI_SETSHOWIMEUIParam is a boolean
SPI_SETSCREENREADERParam is a boolean
SPI_SETSHOWSOUNDSParam is a boolean
SPI_SETMOUSETRAILSParam should be an int specifying the nbr of cursors in the trail (0 or 1 means disabled)
SPI_SETWHEELSCROLLLINESParam is an int specifying nbr of lines
SPI_SETKEYBOARDDELAYParam is an int in the range 0 - 3
SPI_SETKEYBOARDSPEEDParam is an int in the range 0 - 31
SPI_SETDOUBLECLICKTIMEParam is an int (in milliseconds), Use win32gui::GetDoubleClickTime to retrieve the value.
SPI_SETDOUBLECLKWIDTHParam is an int. Use win32api.GetSystemMetrics(SM_CXDOUBLECLK) to retrieve the value.
SPI_SETDOUBLECLKHEIGHTParam is an int, Use win32api.GetSystemMetrics(SM_CYDOUBLECLK) to retrieve the value.
SPI_SETMOUSEHOVERHEIGHTParam is an int
SPI_SETMOUSEHOVERWIDTHParam is an int
SPI_SETMOUSEHOVERTIMEParam is an int
SPI_SETSCREENSAVETIMEOUTParam is an int specifying the timeout in seconds
SPI_SETMENUSHOWDELAYParam is an int specifying the shortcut menu delay in milliseconds
SPI_SETLOWPOWERTIMEOUTParam is an int (in seconds)
SPI_SETPOWEROFFTIMEOUTParam is an int (in seconds)
SPI_SETDRAGHEIGHTParam is an int. Use win32api.GetSystemMetrics(SM_CYDRAG) to retrieve the value.
SPI_SETDRAGWIDTHParam is an int. Use win32api.GetSystemMetrics(SM_CXDRAG) to retrieve the value.
SPI_SETBORDERParam is an int
SPI_GETFONTSMOOTHINGCONTRASTReturns an int
SPI_GETFONTSMOOTHINGTYPEReturns an int
SPI_GETMOUSETRAILSReturns an int specifying the nbr of cursor images in the trail, 0 or 1 indicates disabled
SPI_GETWHEELSCROLLLINESReturns the nbr of lines to scroll for the mouse wheel
SPI_GETKEYBOARDDELAYReturns an int
SPI_GETKEYBOARDSPEEDReturns an int
SPI_GETMOUSESPEEDReturns an int
SPI_GETMOUSEHOVERHEIGHTReturns an int
SPI_GETMOUSEHOVERWIDTHReturns an int
SPI_GETMOUSEHOVERTIMEReturns an int
SPI_GETSCREENSAVETIMEOUTReturns an int (idle time in seconds)
SPI_GETMENUSHOWDELAYReturns an int (shortcut delay in milliseconds)
SPI_GETLOWPOWERTIMEOUTReturns an int (in seconds)
SPI_GETPOWEROFFTIMEOUTReturns an int (in seconds)
SPI_GETACTIVEWNDTRKTIMEOUTReturns an int (milliseconds)
SPI_GETBORDERReturns an int
SPI_GETCARETWIDTHReturns an int
SPI_GETFOREGROUNDFLASHCOUNTReturns an int
SPI_GETFOREGROUNDLOCKTIMEOUTReturns an int
SPI_GETFOCUSBORDERHEIGHTReturns an int
SPI_GETFOCUSBORDERWIDTHReturns an int
SPI_GETMOUSECLICKLOCKTIMEReturns an int (in milliseconds)
SPI_SETFONTSMOOTHINGCONTRASTParam should be an int in the range 1000 to 2200
SPI_SETFONTSMOOTHINGTYPEParam should be one of the FE_FONTSMOOTHING* constants
SPI_SETMOUSESPEEDParam should be an int in the range 1 - 20
SPI_SETACTIVEWNDTRKTIMEOUTParam is an int (in milliseconds)
SPI_SETCARETWIDTHParam is an int (in pixels)
SPI_SETFOREGROUNDFLASHCOUNTParam is an int
SPI_SETFOREGROUNDLOCKTIMEOUTParam is an int (in milliseconds)
SPI_SETFOCUSBORDERHEIGHTReturns an int
SPI_SETFOCUSBORDERWIDTHReturns an int
SPI_SETMOUSECLICKLOCKTIMEParam is an int (in milliseconds)
SPI_GETICONTITLELOGFONTReturns a PyLOGFONT,
SPI_SETICONTITLELOGFONTParam must be a PyLOGFONT,
SPI_SETLANGTOGGLEParam is ignored. Sets the language toggle hotkey from registry key HKCU\\keyboard layout\\toggle
SPI_SETICONSReloads the system icons. Param is not used
SPI_GETMOUSEReturns a tuple of 3 ints containing the x and y mouse thresholds and the acceleration factor.
SPI_SETMOUSEParam should be a sequence of 3 ints
SPI_GETDEFAULTINPUTLANGReturns an int (locale id for default language)
SPI_SETDEFAULTINPUTLANGParam is an int containing a locale id
SPI_GETANIMATIONReturns an int
SPI_SETANIMATIONParam is an int
SPI_ICONHORIZONTALSPACINGFunctions as both a get and set operation. If Param is None, functions as a get operation, otherwise Param is an int to be set as the new value
SPI_ICONVERTICALSPACINGFunctions as both a get and set operation. If Param is None, functions as a get operation, otherwise Param is an int to be set as the new value
SPI_GETNONCLIENTMETRICSParam must be None. The result is a dict.
SPI_SETNONCLIENTMETRICSParam is a dict in the form of a NONCLIENTMETRICS struct, as returned by SPI_GETNONCLIENTMETRICS operation
SPI_GETMINIMIZEDMETRICSReturns a dict representing a MINIMIZEDMETRICS struct. Param is not used.
SPI_SETMINIMIZEDMETRICSParam should be a MINIMIZEDMETRICS dict as returned by SPI_GETMINIMIZEDMETRICS action
SPI_SETDESKPATTERNUnsupported (obsolete)
SPI_GETFASTTASKSWITCHUnsupported (obsolete)
SPI_SETFASTTASKSWITCHUnsupported (obsolete)
SPI_SETSCREENSAVERRUNNINGUnsupported (documented as internal use only)
SPI_SCREENSAVERRUNNINGSame as SPI_SETSCREENSAVERRUNNING
SPI_SETPENWINDOWSUnsupported (only relevant for win95)
SPI_GETWINDOWSEXTENSIONUnsupported (only relevant for win95)
SPI_GETGRIDGRANULARITYUnsupported (obsolete)
SPI_SETGRIDGRANULARITYUnsupported (obsolete)
SPI_LANGDRIVERUnsupported (use is not documented)
SPI_GETFONTSMOOTHINGORIENTATIONUnsupported (use is not documented)
SPI_SETFONTSMOOTHINGORIENTATIONUnsupported (use is not documented)
SPI_SETHANDHELDUnsupported (use is not documented)
SPI_GETICONMETRICSNot implemented yet
SPI_SETICONMETRICSNot implemented yet
SPI_GETWORKAREANot implemented yet
SPI_SETWORKAREANot implemented yet
SPI_GETSERIALKEYSNot implemented yet
SPI_SETSERIALKEYSNot implemented yet
SPI_SETMOUSEKEYSNot implemented yet
SPI_GETMOUSEKEYSNot implemented yet
SPI_GETHIGHCONTRASTNot implemented yet
SPI_SETHIGHCONTRASTNot implemented yet
SPI_GETSOUNDSENTRYNot implemented yet
SPI_SETSOUNDSENTRYNot implemented yet
SPI_GETSTICKYKEYSNot implemented yet
SPI_SETSTICKYKEYSNot implemented yet
SPI_GETTOGGLEKEYSNot implemented yet
SPI_SETTOGGLEKEYSNot implemented yet
SPI_GETACCESSTIMEOUTNot implemented yet
SPI_SETACCESSTIMEOUTNot implemented yet
SPI_GETFILTERKEYSNot implemented yet
SPI_SETFILTERKEYSNot implemented yet

Comments

Param and WinIni are not used with any of the SPI_GET operations
Boolean parameters can be any object that can be evaluated as True or False

Return Value

SPI_SET functions all return None on success. Types returned by SPI_GET functions are dependent on the operation