Change the Desktop wallpaper 
Author Message
 Change the Desktop wallpaper

Hi,
Does anyone know a way to change the DeskTop wallpaper by a VB5 program.
Thanks

Bruno.



Sun, 15 Oct 2000 03:00:00 GMT  
 Change the Desktop wallpaper

There is an API function called SystemParametersInfo that will set this
windows configuration. Also, there is a property in the WIN.INI file where
it can be changed.

Eric

All of the material presented here is copyrighted by either Desaware or
Macmillan. No part of this material may be used or reproduced in any fashion
(except in brief quotations used in critical articles and reviews) without
prior consent.

Quote:

>Hi,
>Does anyone know a way to change the DeskTop wallpaper by a VB5 program.
>Thanks

>Bruno.




Sun, 15 Oct 2000 03:00:00 GMT  
 Change the Desktop wallpaper

This should do it for you:

'In General Declarations:
Declare Function SystemParametersInfo Lib "user32" _
Alias "SystemParametersInfoA" (ByVal uAction As Long, _
ByVal uParam As Long, ByVal lpvParam As Any, _
ByVal fuWinIni As Long) As Long
Public Const SPI_SETDESKWALLPAPER = 20
Public Const SPIF_SENDWININICHANGE = &H2
Public Const SPIF_UPDATEINIFILE = &H1

'Add this subroutine:
Public Sub SetWallpaper(ByVal FileName As String)
  Dim x As Long
  x = SystemParametersInfo(SPI_SETDESKWALLPAPER, _
  0&, FileName, SPIF_SENDWININICHANGE Or SPIF_UPDATEINIFILE)
End Sub

--
Ben Baird, MVP
Microsoft SiteBuilder Network Level 2
Visual Basic Thunder, v. 2.0
http://www.{*filter*}highway.com/~psy/
Common Controls Replacement Project, Official Member
http://www.*-*-*.com/
Please direct your programming questions to the newsgroups.

Quote:

>Hi,
>Does anyone know a way to change the DeskTop wallpaper by a VB5 program.



Sun, 15 Oct 2000 03:00:00 GMT  
 Change the Desktop wallpaper

go to:
http://members.xoom.com/whizkid/vb/wall.html

there is a complete example/source code on changing wallpaper,
you can also set TILE, RESIZE and CENTER attributes.

thanx

Quote:
>Hi,
>Does anyone know a way to change the DeskTop wallpaper by a VB5 program.
>Thanks

>Bruno.




Wed, 18 Oct 2000 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. How can I change the Desktop Wallpaper from a VB application

2. How do i do a vbscript to change my desktop wallpaper when my computer start

3. change the desktop wallpaper

4. Wallpaper does not change with Active Desktop

5. Change Desktop Wallpaper

6. Help API changing desktop wallpaper

7. Wallpaper does not change with Active Desktop

8. Changing wallpaper on desktop

9. Changing Wallpaper & Desktop Settings

10. How to change desktop wallpaper

11. Changing HTML Wallpaper for Active Desktop

12. Changing Desktop Wallpaper from code using JPG files

 

 
Powered by phpBB® Forum Software