SystemParametersInfo
The SystemParametersInfo function retrieves or sets the value of one of the system-wide parameters. This function can also update the user profile while setting a parameter. BOOL SystemParametersInfo(
  UINT uiAction,  // system parameter to retrieve or set
  UINT uiParam,   // depends on action to be taken
  PVOID pvParam,  // depends on action to be taken
  UINT fWinIni    // user profile update option
);
Parametersui
Action 
[in] Specifies the system-wide parameter to retrieve or set. This parameter can be one of the values from the following tables. 
The following are the accessibility parameters. 
The following are the power parameters. Power parameter Meaning 
SPI_GETLOWPOWERACTIVE Determines whether the low-power phase of screen saving is enabled. The pvParam parameter must point to a BOOL variable that receives TRUE if enabled, or FALSE if disabled. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit. It is not supported for 16-bit applications.
 
SPI_GETLOWPOWERTIMEOUT Retrieves the time-out value for the low-power phase of screen saving. The pvParam parameter must point to an integer variable that receives the value. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_GETPOWEROFFACTIVE Determines whether the power-off phase of screen saving is enabled. The pvParam parameter must point to a BOOL variable that receives TRUE if enabled, or FALSE if disabled. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_GETPOWEROFFTIMEOUT Retrieves the time-out value for the power-off phase of screen saving. The pvParam parameter must point to an integer variable that receives the value. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_SETLOWPOWERACTIVE Activates or deactivates the low-power phase of screen saving. Set uiParam to 1 to activate, or zero to deactivate. The pvParam parameter must be NULL. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_SETLOWPOWERTIMEOUT Sets the time-out value, in seconds, for the low-power phase of screen saving. The uiParam parameter specifies the new value. The pvParam parameter must be NULL. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_SETPOWEROFFACTIVE Activates or deactivates the power-off phase of screen saving. Set uiParam to 1 to activate, or zero to deactivate. The pvParam parameter must be NULL. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 
SPI_SETPOWEROFFTIMEOUT Sets the time-out value, in seconds, for the power-off phase of screen saving. The uiParam parameter specifies the new value. The pvParam parameter must be NULL. 
Windows 98/Me: This flag is supported for 16-bit and 32-bit applications. Windows 95: This flag is supported for 16-bit applications only. Windows 2000/XP: This flag is supported for 32-bit applications. It is not supported for 16-bit applications.
 The following are the screen saver parameters. Screen saver parameter Meaning 
SPI_GETSCREENSAVEACTIVE Determines whether screen saving is enabled. The pvParam parameter must point to a BOOL variable that receives TRUE if screen saving is enabled, or FALSE otherwise. 
SPI_GETSCREENSAVERRUNNING Windows 98/Me, Windows 2000/XP: Determines whether a screen saver is currently running on the window station of the calling process. The pvParam parameter must point to a BOOL variable that receives TRUE if a screen saver is currently running, or FALSE otherwise. Note that only the interactive window station, "WinSta0", can have a screen saver running. 
SPI_GETSCREENSAVETIMEOUT Retrieves the screen saver time-out value, in seconds. The pvParam parameter must point to an integer variable that receives the value. 
SPI_SETSCREENSAVEACTIVE Sets the state of the screen saver. The uiParam parameter specifies TRUE to activate screen saving, or FALSE to deactivate it. 
SPI_SETSCREENSAVERRUNNING Windows 95/98/Me: Used internally; applications should not use this flag. 
SPI_SETSCREENSAVETIMEOUT Sets the screen saver time-out value to the value of the uiParam parameter. This value is the amount of time, in seconds, that the system must be idle before the screen saver activates.