Skip to main content

 none
Gadget Idea to Adjust Screen Brightness on Laptops RRS feed

  • Question

  • I was wondering if anyone knew of or could create a gadget that has a simple slider up and down that can adjust the brightness of the screen on notebook displays from brightest to complete black... don't forget to add a keystroke to bring it back to bright in case you make it dark and then forget how to turn it back up.
    Sunday, May 6, 2007 7:53 PM

All replies

  • Great idea! Im desperately trying to find a gadget that does this, any handy person out there that can make one? Smile

    Cheers!
    Wednesday, May 16, 2007 9:20 AM
  • I don't really have time to chase this up, so if someone else wants to look into it, here's what I have so far.  In Vista, it's possible to use WMI to change brightness.  The following script might give you an idea of how it may work:

    Code Snippet
    var wmi = GetObject("winmgmts:root\\wmi");
    var mbm = wmi.get("WmiMonitorBrightnessMethods");
    mbm.WmiSetBrightness(100, 0);

     
    see here: http://msdn2.microsoft.com/en-us/library/aa394549.aspx

    Of course, this script won't work for me.  I get an "Invalid method parameter(s)" error because the parameters for WmiSetBrightness need to be UInt8 and UInt64 data types respectively.  Unfortunately, you can't declare these data types in JScript - so the script fails on the third line.  If anyone knows of a way to get this working in JScript/VBScript then great.  Other than that it would have to be an ActiveX control.

    Andy


    Wednesday, May 16, 2007 11:50 AM
  • I don't think it's a type issue,.  Using the InParameters method also results in the same error:

    Code Snippet

    var oWMI = GetObject("winmgmts://./root/WMI");

    var oWDDM = oWMI.Get("WmiMonitorBrightnessMethods");

    var oinParameters = oWDDM.Methods_("WmiSetBrightness").inParameters.SpawnInstance_();   

    oinParameters.Properties_.Item("Brightness") = 100;

    var oOut = oWDDM.ExecMethod_("WmiSetBrightness", oinParameters);

    • Proposed as answer by l00k Tuesday, November 23, 2010 9:54 AM
    Wednesday, May 16, 2007 6:47 PM
  • To verify, build a little C/C++ or C# app that makes the WMI call with proper types.  If that works but scripting doesn't, expand your test app into an ActiveX control that exposes brightness functionality.

     

    Edit:  My concern with this functionality would be that it's not exactly a standard across laptops.  This wouldn't be the first time WMI "exposed" something as a no-op (see temperature information, for example).  This might work, or it might be a non-functional stub intended for future expansion.  The docs don't say either way.

     

    Edit:  A bit further research shows that the Vista Mobility Center (available on laptops, not sure about desktops) uses WMI to do screen brightness.  If your WMI calls are failing, check the Mobility Center to see if it has the Brightness widget.  Not all machines will, even if they are laptops.  For example, my Dell Inspiron 9300 doesn't have brightness control in Mobility Center, and thus I assume it would also fail the WMI call (haven't tested).  The laptop does have brightness buttons that work, but the hardware buttons go through the ACPI 3.0 interface and not WMI like Mobility Center.

    Wednesday, May 16, 2007 8:34 PM
  • I tried the inParameters method too, but I didn't realise that was a workaround for the type.

    As far as I can remember, I read somewhere that the new method for adjusting screen brightness was standard (WMI) for all Vista machines.  Of course, older machines that were upgraded to Vista might not work.  On older machines, it might be possible to adjust the brightness using a graphics card API (like NVidia's NvCpl.dll).

    In any case, my laptop does have the setting for brightness in the Mobility Center and the WMI option *still* doesn't work.

    Andy
    Thursday, May 17, 2007 9:38 AM
  • It would be even better if, in the same gadget, there was a slider for volume control.  Smile  Thanks for working on this guys!
    Saturday, May 19, 2007 2:12 PM
  •  TNDell wrote:
    It would be even better if, in the same gadget, there was a slider for volume control.    Thanks for working on this guys!

     

    See here for an explanation of why a volume control gadget will be very unlikely.

    Saturday, May 19, 2007 8:29 PM
  • Saturday, May 9, 2009 11:38 PM