共用方式為


SystemParametersInfo

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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

Syntax

BOOL SystemParametersInfo( 
  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_GETBATTERYIDLETIMEOUT

    Retrieves the amount of time that Windows Embedded 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 the function will return 0.

    SPI_GETBOOTMENAME

    Returns the device BOOTME name (i.e. “CEPC53902”).

    SPI_GETEXTERNALIDLETIMEOUT

    Retrieves the amount of time that Windows Embedded 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 the function will return 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_GETGUIDPATTERN

    Returns platform-specific GUID pattern.

    SPI_GETMOUSE

    Retrieves the two mouse threshold values and the mouse speed.

    SPI_GETOEMINFO

    Returns a string value of no more than 256 Unicode characters and contains the model number and manufacturer name.

    The return value must always be the same, even if the device is updated to a new version of Windows Mobile .

    The uiParam parameter specifies the length of the buffer in pvParam, which on successful return contains the string in Unicode characters.

    SPI_GETPLATFORMMANUFACTURER

    Returns a human readable, not-null text string for the platform manufacturer (OEM) name.

    The string must be at least one character in length and less than 256 characters in length.

    SPI_GETPLATFORMNAME

    Returns a human readable, not-null text string for the platform (product) release name (i.e. “CEPC”).

    The string must be at least one character in length and less than 256 characters in length.

    SPI_GETPLATFORMTYPE

    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. Returns {{CE_MAJOR_VER, CE_MINOR_VER}}, regardless of platform.

    SPI_GETPROJECTNAME

    Returns a project description string (i.e. “CEBase”).

    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_GETUUID

    Returns hardware-unique bytes for the platform.

    SPI_GETWAKEUPIDLETIMEOUT

    Retrieves the amount of time that Windows Embedded 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 the function will return 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.

    On Windows Mobile Standard, the size of the work area returned does not include the menu bar. On Windows Mobile Classic and Windows Mobile Professional, the size of the work area returned includes the menu bar.

    SPI_SETBATTERYIDLETIMEOUT

    Sets the amount of time that Windows Embedded CE will stay on with battery power before it suspends due to user inaction. The Windows Embedded 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 Embedded CE will stay on with AC power before it suspends due to user inaction. The Windows Embedded 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_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_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_SETWAKEUPIDLETIMEOUT

    Sets the amount of time that Windows Embedded 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.

    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 Value

Nonzero indicates success. Zero indicates failure. This function will return 0 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 Embedded 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_MININPUT

SPI_GETSCREENSAVETIMEOUT SPI_SETSCREENSAVETIMEOUT SPI_SETBATTERYIDLETIMEOUT SPI_GETBATTERYIDLETIMEOUT SPI_SETEXTERNALIDLETIMEOUT SPI_GETEXTERNALIDLETIMEOUT SPI_SETWAKEUPIDLETIMEOUT SPI_GETWAKEUPIDLETIMEOUT

Requirements

Header winuser.h
Library coredll.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

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

Other Resources

GetMonitorInfo