Example Programs

Showing results for 
Search instead for 
Did you mean: 

Set Windows Desktop Background Image in LabVIEW


The Windows API is a very powerful tool that will let you, for the most part, completely customize your environment programmatically.



This example uses the Windows API to programmatically set the the desktop wallpaper image.  This program uses the user32.dll and the SystemParameeresInfoA function to set the background image.



  • LabVIEW 2013 (or compatible).


Steps to Implement or Execute Code

  1. Simply select a path to an image and run the code.
  2. The background with change to the image you selected.

Additional Information or References

VI Snippet







Call Library function configuration




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

Cole R.
National Instruments
Software Engineer
Member Dave_St

Thanks for this! I was messing around with making tile patterns for my desktop and getting tired of resetting the desktop background manually over and over.


I have one note to add: I had to make sure that the image was saved as a bitmap before it would work. If the image is saved as, say a png, it will not change the background and also not throw an error. It might work for other image types but I didn't test them all.