Example Code

LabVIEW Change Desktop Background upon keyboard press

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

Download All

Overview
This example calls Windows DLL to change desktop background, operating by keyboard.

 
Description
This VI is a simple prank that runs upon opening it, is set to be completely transparent and perfectly blends in on a computer that has a lot of Vis open by only using property and invoke nodes. By calling a Windows dll and using the LabVIEW inbuilt input device acquisition functions the VI waits until L is pressed and changes the desktop background with your image xxx.jpg as long as the image is in the same folder as the VI and has the same name in your VI. Then only after the background has been changed it allows to close the VI by pressing E covering the cause of the background change.

 

Requirements

  1. LabVIEW 2014(or compatible)


Steps to Implement or Execute Code

  1. To run the VI you need to have the VI and an image in the same folder, make sure the image name matches the one in the code.
  2. Simply double click the VI and it runs.
  3. Press L to change the wallpaper.
  4. Press E to exit.

 

Additional Information or References

NI Snippet

243.png

 

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

Applications Engineer
National Instruments UK & Ireland

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

Comments
Member
Member
on

most stupid program idea what I faced during my life.... (facepalm)