To download NI software, including the products shown below, visit ni.com/downloads.
Overview
The Windows API is a very powerful tool that will let you, for the most part, completely customize your environment programmatically.
Description
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.
Requirements
Steps to Implement or Execute Code
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.**
Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.
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.
Thank you for this example, it really helped.
I have noticed that, at least on Win10, using the example code does change the background but it changes back on reboot.
Changing the bottom option to 1 instead of 0 keeps the background even on PC reboot.
It might be a good idea to update the code example with this change.