Example Code

Use Keyboard Hotkeys to Control Master System Volume using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This example code first listens for button presses on the keyboard. If the correct key is pressed, the program executes a Windows API call through user32.dll to increase, decrease, or mute the volume.


Description
This example code first listens for button presses on the keyboard. If the correct key is pressed, the program executes a Windows API call through user32.dll to increase, decrease, or mute the volume.

  1. Run the VolumeMaster.vi
  2. Press F10 to lower the volume, F11 to mute, and F12 to increase the volume.

 
Requirements

Software:

LabVIEW 2012(or compatible)

 

Steps to Implement or Execute Code

  1. Download the .zip file
  2. Set your desired configuration (a, x1, x2, degrees, etc)
  3. Run the VI

 

Additional Information or References
VI Block Diagram

1.png

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.