Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WmiSetBrightness method of the WmiMonitorBrightnessMethods class

The WmiSetBrightness method sets the display brightness of a computer monitor.

Syntax


uint32 WmiSetBrightness(
   uint32 Timeout,
   uint8  Brightness
);

Parameters

Timeout

Timeout, in seconds.

Brightness

Brightness, in percent.

Return value

Returns zero (0) to indicate success. Any other number indicates an error. For more information about error codes, see WMI Error Constants or WbemErrorEnum.

Examples

For an extended discussion of retrieving and setting monitor brightness, see the Scripting Guy's Use PowerShell to Report and Set Monitor Brightness blog topic.

The following PowerShell sample sets the brightness of the monitor to 50%.


$brightness = 50
$delay = 5
$myMonitor = Get-WmiObject -Namespace root\wmi -Class WmiMonitorBrightnessMethods
$myMonitor.wmisetbrightness($delay, $brightness)

Requirements

Minimum supported client

Windows Vista

Minimum supported server

Windows Server 2008

Namespace

Root\wmi

MOF

WmiCore.mof

DLL

WmiProv.dll

See also

WmiMonitorBrightnessMethods
MSMonitorClass

 

 

Community Additions

Show:
© 2015 Microsoft