VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Correctly setting Desktop Wallpaper

Steven Henning  (1 Submission)   Windows API Call/Explanation   Visual Basic 3.0   Unknown Difficulty   Wed 3rd February 2021

I got tired of trying every wallpaper example on this site and finding they didn't work
on Windows NT.
This shows the example from Microsoft of how to correctly set the Desktop Wallpaper
from Visual Basic.
Original code is from :-
https://msdn.microsoft.com/library/techart/msdn_msdn192.htm
Seeing
we are not allowed to link to another site, I just copied the code from
the above URL and modified it slightly.

Assumes
Add a Command Button control to Form1. Command1 is created by default. Set its Caption property to "Remove Wallpaper". Add a second Command Button control to Form1. Command2 is created by default. Set its Caption property to "Change Wallpaper".

API Declarations
Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam _
As Long, ByVal lpvParam As String, ByVal fuWinIni As Long) As Long
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1
Const SPIF_SENDWININICHANGE = &H2

Rate Correctly setting Desktop Wallpaper (40(40 Vote))
Correctly setting Desktop Wallpaper.bas

Correctly setting Desktop Wallpaper Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters