Function Reference


_WinAPI_SystemParametersInfo

Retrieves or sets the value of one of the system-wide parameters

#include <WinAPI.au3>
_WinAPI_SystemParametersInfo ( $iAction [, $iParam = 0 [, $vParam = 0 [, $iWinIni = 0]]] )

Parameters

$iAction The system-wide parameter to be retrieved or set
$iParam [optional] A parameter whose usage and format depends on the parameter being queried or set
$vParam [optional] A parameter whose usage and format depends on the parameter being queried or set
$iWinIni [optional] 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. This parameter can be zero if you don't want
to update the user profile or it can be one or more of the following values:
$SPIF_UPDATEINIFILE - Writes the new setting to the user profile
$SPIF_SENDCHANGE - Broadcasts the $WM_SETTINGCHANGE message after updating the user profile

Return Value

Success: True
Failure: False, call _WinAPI_GetLastError() to get extended error information

Remarks

This function always call the Unicode version so $vParam must be inaccordance when using strings.

See Also

Search SystemParametersInfo in MSDN Library.

Example

#include <Array.au3>
#include <WinAPI.au3>
#include <WinAPIsysinfoConstants.au3>
#include <WindowsConstants.au3>

Local $aArray = GetWorkArea()
_ArrayDisplay($aArray, _WinAPI_GetSystemMetrics($SM_CXVIRTUALSCREEN) & ', ' & _WinAPI_GetSystemMetrics($SM_CYVIRTUALSCREEN))

; Get the working visible area of the desktop, this doesn't include the area covered by the taskbar.
Func GetWorkArea()
    Local $tWorkArea = DllStructCreate($tagRECT)
    _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0, $tWorkArea)
    Local $aReturn[4] = [DllStructGetData($tWorkArea, 'Left'), DllStructGetData($tWorkArea, 'Top'), _
            DllStructGetData($tWorkArea, 'Right') - DllStructGetData($tWorkArea, 'Left'), DllStructGetData($tWorkArea, 'Bottom') - DllStructGetData($tWorkArea, 'Top')]
    Return $aReturn
EndFunc   ;==>GetWorkArea