ContextualFabric Webdesign

Witzenhausen

  • Increase font size
  • Default font size
  • Decrease font size

NVIDIA Brightness Control Visual Basic 6 (VB6)

Sitting behind the computer in the early morning, I really liked to have the brightness of my two LCD monitors dimmed a bit and ajusted to the little light, like I would do on my laptop.

So I looked up the API for the NVIDIA graphic card:

http://developer.download.nvidia.com/SDK/9.5/Samples/DEMOS/common/src/NvCpl/docs/NVControlPanel_API.pdf

The DTCFG Desktop Configuration Commands supply a function:

 

setbrightness
set_normalize_brightness
Description Set the brightness level of the specified display. This command overrides
previous seticm settings.
Format rundll32.exe NvCpl.dll,dtcfg setbrightness
<display#> [<NV device moniker>] <color channel>
<value:-125—125>
Where
• color channel is one of the following:
• red
• blue
• green
• all
• value is in the range -125 through 125.
Example rundll32.exe NvCpl.dll,dtcfg setbrightness 2 all 100
Sets the brightness level for all color channels on display #2 to 100.

setbrightness

Description

 Set the brightness level of the specified display. This command overrides previous seticm settings.

Format

rundll32.exe NvCpl.dll,dtcfg setbrightness <display#> [<NV device moniker>] <color channel> <value:-125—125>

Where color channel is one of the following:

  • red
  • blue
  • green
  • all

value is in the range -125 through 125.

Example

rundll32.exe NvCpl.dll,dtcfg setbrightness 2 all 100

Sets the brightness level for all color channels on display #2 to 100.

Example code (VB6) simply uses shell command to execute the command.

Compiled executable

Software disclaimer

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.