Compartilhar via


SystemParametersInfo (Windows CE 5.0)

Send Feedback

This function queries or sets system-wide parameters, and updates the user profile during the process.

BOOLSystemParametersInfo( UINT uiAction, UINT uiParam, PVOID pvParam, UINT fWinIni);

Parameters

  • uiAction
    [in] Specifies the system-wide parameter to query or set. This parameter can be one of the following values, depending on the sysgen variable that is set. For more information, see the Remarks section.

    Value Description
    SPI_APPBUTTONCHANGE Retrieves the application button mappings.
    SPI_GETACCESSTIMEOUT Retrieves information about the time-out period associated with the accessibility options. The pvParam parameter must point to an ACCESSTIMEOUT structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(ACCESSTIMEOUT). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETBATTERYIDLETIMEOUT Retrieves the amount of time that Windows CE will stay on with battery power before it suspends due to user inaction. The pvParam parameter points to a DWORD that returns the time in seconds. This flag is ignored if pvParam is zero.

    If you disable GWES suspend management then this value will read 0.

    SPI_GETEXTERNALIDLETIMEOUT Retrieves the amount of time that Windows CE will stay on with AC power before it suspends due to user inaction. The pvParam parameter points to a DWORD that returns the time in seconds. This flag is ignored if pvParam is zero.

    If you disable GWES suspend management then this value will read 0.

    SPI_GETFONTSMOOTHING Determines whether the font smoothing feature is enabled. This capability uses font antialiasing to make font curves appear smoother by painting pixels at different gray levels. Font smoothing is required for Microsoft® ClearType® support.

    The pvParam parameter must point to a BOOL variable that receives TRUE if the feature is enabled, or FALSE if it is not.

    SPI_GETFONTSMOOTHINGCONTRAST Retrieves a contrast value that is used in smoothing text displayed using Microsoft® ClearType®. The pvParam parameter must point to a UINT that receives the information.
    SPI_GETHIGHCONTRAST Retrieves information about the high-contrast accessibility option. The pvParam parameter must point to a HIGHCONTRAST structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(HIGHCONTRAST). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETMOUSE Retrieves the two mouse threshold values and the mouse speed.
    SPI_GETMOUSEKEYS Retrieves information about the mouse keys accessibility option. The pvParam parameter must point to a MOUSEKEYS structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(MOUSEKEYS). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETOEMINFO Returns a string containing the model number and manufacturer name. The uiParam parameter specifies the length of the buffer in pvParam, which on successful return contains the string in Unicode characters.
    SPI_GETPLATFORMTYPE Returns a string specifying the type of Windows CE device. The uiParam parameter specifies the number of characters in the buffer in pvParam, which on successful return contains the string in Unicode characters. This string allows applications to determine the device type.
    SPI_GETPLATFORMVERSION Assigns a version number to an OEM OS design, when used in conjunction with the SPI_GETPLATFORMTYPE IOCTL. For more information, see Implementation of the SPI_GETPLATFORMVERSION IOCTL.
    SPI_GETSCREENSAVETIMEOUT Retrieves the screen saver time-out value, in seconds. The pvParam parameter must point to an integer that receives the value. This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETSHOWSOUNDS Retrieves whether the show sounds option is on or off. If the option is on, the user requires an application to present information visually in situations where the application otherwise only presents the information audibly. The pvParam parameter must point to a parameter of type BOOL that receives TRUE if the feature is on or FALSE if the feature is off. This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETSOUNDSENTRY Retrieves information about the sound sentry accessibility option. The pvParam parameter must point to a SOUNDSENTRY structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(SOUNDSENTRY). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETSTICKYKEYS Retrieves information about the sticky keys accessibility option. The pvParam parameter must point to a STICKYKEYS structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(STICKYKEYS). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETTOGGLEKEYS Retrieves information about the toggle keys accessibility option. The pvParam parameter must point to a TOGGLEKEYS structure that receives the information. Set the cbSize member of this structure and the uiParam parameter to sizeof(TOGGLEKEYS). This value is supported in Windows CE .NET 4.0 and later.
    SPI_GETWAKEUPIDLETIMEOUT Retrieves the amount of time that Windows CE will stay on after a user notification that reactivates a suspended device. The pvParam parameter points to a DWORD that returns the time in seconds. This flag is ignored if pvParam is zero.

    If you disable GWES suspend management then this value will read 0.

    SPI_GETWHEELSCROLLLINES Gets the number of lines to scroll when the mouse wheel is rotated. The pvParam parameter must point to a UINT variable that receives the number of lines. The default value is 3.
    SPI_GETWORKAREA Retrieves the size of the work area on the primary screen. The work area is the portion of the screen not obscured by the system task bar or by toolbars displayed on the desktop by applications. The pvParam parameter must point to a RECT structure that receives the coordinates of the work area, expressed in virtual screen coordinates.

    To get the work area of a screen other than the primary screen, call the GetMonitorInfo function.

    SPI_SETACCESSTIMEOUT Sets the time-out period associated with the accessibility options. The pvParam parameter must point to an ACCESSTIMEOUT structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(ACCESSTIMEOUT). This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETBATTERYIDLETIMEOUT Sets the amount of time that Windows CE will stay on with battery power before it suspends due to user inaction. The Windows CE operating system will remain on, with battery power, as long as the keyboard or touch screen is active. The uiParam parameter specifies the time to set in seconds. This flag is ignored if uiParam is set to zero.

    If you disable GWES suspend management then attempts to set this parameter will fail, returning ERROR_RESOURCE_DISABLED.

    SPI_SETEXTERNALIDLETIMEOUT Sets the amount of time that Windows CE will stay on with AC power before it suspends due to user inaction. The Windows CE operating system will remain on, with AC power, as long as the keyboard or touch screen is active. The uiParam parameter specifies the time in seconds. This flag is ignored if uiParam is set to zero.

    If you disable GWES suspend management then attempts to set this parameter will fail, returning ERROR_RESOURCE_DISABLED.

    SPI_SETFONTSMOOTHING Enables or disables font smoothing, which uses font antialiasing to make font curves appear smoother by painting pixels at different gray levels. Font smoothing is required for Microsoft® ClearType® support.

    To enable this capability, set the uiParam parameter to TRUE. To disable it, set uiParam to FALSE.

    SPI_SETFONTSMOOTHINGCONTRAST Sets the contrast value used when displaying text in a ClearType font. The pvParam parameter points to a UINT that holds the contrast value. Valid contrast values are from 1000 to 2200. These values correspond to physical contrast values from 1.0 to 2.2. The default value is 1400. This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETHIGHCONTRAST Sets the properties of the high-contrast accessibility option. The pvParam parameter must point to a HIGHCONTRAST structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(HIGHCONTRAST). This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETMOUSE Sets the two mouse threshold values and the mouse speed. When you make this call, GWES performs the following tasks:
    • GWES updates a global variable with the speed setting.
    • GWES writes the speed value to HKCU\Control Panel\Mouse\MouseSpeed. (The other two values update MouseThreshold1 and MouseThreshold2.)

    When a relative mouse movement event occurs (not a MOUSEEVENTF_ABSOLUTE event), GWES accelerates large movements if the MouseSpeed setting is nonzero. The movement is a delta in the X and Y range.

    During acceleration, if the delta is larger than MouseThreshold1, it is doubled.

    During acceleration, if the delta is larger than MouseThreshold1 and MouseThreshold2, and if MouseSpeed is 2, it is doubled again.

    Depending on the size of the mouse movement and the settings of MouseThreshold1, MouseThreshold2, and MouseSpeed, the actual position delta will be unchanged, doubled, or quadrupled. This calculation is carried out independently for the X and Y coordinates.

    SPI_SETMOUSEKEYS Sets the properties of the mouse keys accessibility option. The pvParam parameter must point to a MOUSEKEYS structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(MOUSEKEYS). This value is supported in Windows CE .NET 4.0 and later.
    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 remain idle before the screen saver activates. This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETSHOWSOUNDS Turns the show sounds accessibility option on or off. Set the pvParam parameter to TRUE to turn the option on or to FALSE the turn the feature off. This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETSOUNDSENTRY Sets the properties of the sound sentry accessibility option. The pvParam parameter must point to a SOUNDSENTRY structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(SOUNDSENTRY). This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETSTICKYKEYS Sets the properties of the sticky keys accessibility option. The pvParam parameter must point to a STICKYKEYS structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(STICKYKEYS). This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETTOGGLEKEYS Sets the properties of the toggle keys accessibility option. The pvParam parameter must point to a TOGGLEKEYS structure that contains the new parameters. Set the cbSize member of this structure and the uiParam parameter to sizeof(TOGGLEKEYS). This value is supported in Windows CE .NET 4.0 and later.
    SPI_SETWAKEUPIDLETIMEOUT Sets the amount of time that Windows CE will stay on after a user notification that reactivates the suspended device. The uiParam parameter specifies the time in seconds. This flag is ignored if uiParam is set to zero.

    If you disable GWES suspend management then attempts to set this parameter will fail, returning ERROR_RESOURCE_DISABLED.

    SPI_SETWHEELSCROLLLINES Sets the number of lines to scroll when the mouse wheel is rotated. The number of lines is set from the uiParam parameter.

    The number of lines is the suggested number of lines to scroll when the mouse wheel is rolled without using modifier keys. If the number is 0, then no scrolling should occur. If the number of lines to scroll is greater than the number of lines viewable, and especially if it is WHEEL_PAGESCROLL (whose value is UINT_MAX), the scroll operation should be interpreted as clicking once in the page down or page up regions of the scroll bar.

    SPI_SETWORKAREA Sets the size of the work area — the portion of the screen not obscured by the system taskbar or by toolbars displayed on the desktop by applications. The pvParam parameter is a pointer to a RECT structure that specifies the new work area rectangle, expressed in virtual screen coordinates. In a system with multiple screens, the function sets the work area of the monitor that contains the specified rectangle.

    If pvParam is NULL, the function sets the work area of the primary screen to the full screen.

  • uiParam
    [in] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify zero for this parameter.

  • pvParam
    [out] Depends on the system parameter being queried or set. For more information about system-wide parameters, see the uiAction parameter. If not otherwise indicated, you must specify NULL for this parameter.

    If the pvParam buffer is used to get the platform type or OEM information string and the buffer is too small, this function fails with ERROR_INSUFFICIENT_BUFFER in the last error.

  • fWinIni
    [in] Boolean that, if a system parameter is being set, specifies whether the user profile is to be updated, and if so, whether the WM_SETTINGCHANGE message is to be broadcast to all top-level windows to notify them of the change. This parameter can be zero or can be one of the following values.

    Value Description
    SPIF_UPDATEINIFILE Writes the new system-wide parameter setting to the user profile.
    SPIF_SENDCHANGE Broadcasts the WM_SETTINGCHANGE message.

Return Values

Nonzero indicates success. Zero indicates failure. This function will return ERROR_RESOURCE_DISABLED if you attempt to set the values SPI_SETBATTERYIDLETIMEOUT, SPI_SETEXTERNALIDLETIMEOUT, or SPI_SETWAKEUPIDLETIMEOUT when GWES suspend management is disabled.

To get extended error information, call GetLastError.

Remarks

Windows CE supports only the Unicode version of this function.

This function is intended for use with applications, such as Control Panel, that allow the user to customize the environment.

If you have both sticky keys and high contrast enabled, the HIGHCONTRAST hot keys have to be pressed sequentially and not simultaneously to toggle HIGHCONTRAST on or off. The correct key sequence is to press and release LEFT ALT, then press and release LEFT SHIFT, and then press and release PRINTSCRN.

The values of parameter uiAction depend on the sysgen values that are set when building the run-time image. The following table shows which values are available for a given sysgen.

Sysgen Value
SYSGEN_TOUCH or SYSGEN_CURSOR SPI_SETMOUSE
SPI_GETMOUSE
SYSGEN_ACCESSIB SPI_GETTOGGLEKEYS
SPI_SETTOGGLEKEYS
SPI_GETMOUSEKEYS
SPI_SETMOUSEKEYS
SPI_GETSTICKYKEYS
SPI_SETSTICKYKEYS
SPI_GETACCESSTIMEOUT
SPI_SETACCESSTIMEOUT
SPI_GETSOUNDSENTRY
SPI_SETSOUNDSENTRY
SPI_GETHIGHCONTRAST
SPI_SETHIGHCONTRAST
SYSGEN_MININPUT SPI_GETSCREENSAVETIMEOUT
SPI_SETSCREENSAVETIMEOUT
SPI_SETBATTERYIDLETIMEOUT
SPI_GETBATTERYIDLETIMEOUT
SPI_SETEXTERNALIDLETIMEOUT
SPI_GETEXTERNALIDLETIMEOUT
SPI_SETWAKEUPIDLETIMEOUT
SPI_GETWAKEUPIDLETIMEOUT

Requirements

OS Versions: Windows CE 2.0 and later.
Header: Winuser.h.
Link Library: Coredll.lib.

See Also

GetMonitorInfo | GetSystemMetrics | WM_SETTINGCHANGE | ACCESSTIMEOUT | HIGHCONTRAST | MOUSEKEYS | SIPINFO | SOUNDSENTRY | STICKYKEYS | TOGGLEKEYS | System Information Functions

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.