Example Program Drafts

Showing results for 
Search instead for 
Did you mean: 

Set Windows Desktop Background Image

by Member Cole_R ‎08-29-2014 07:02 AM - edited ‎01-30-2017 10:28 AM

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 programatically set the the desktop wallpaper image.  This program uses the user32.dll and the SystemParameeresInfoA function to set the background image.


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.

Requirements

Software

LabVIEW

Additional Images or Video

VI Snippet

SetDesktopBackground.png

Call Library function configuration:

CallLibraryConfig.PNG

Comments
Member Dave_St
Member

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.

Contributors