|
-
February 10th, 2000, 10:36 AM
#1
Windowz Backroundz
how do i change the windows backround through vb code, apparently, www.freevbcode.com and www.vbcode.com arent working right now.
-
February 10th, 2000, 10:45 AM
#2
Re: Windows Backround
Place a button on a form and then copy in the following code :
option Explicit
'
private 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
'
private Const SPIF_SENDWININICHANGE = &H2
private Const SPIF_UPDATEINIFILE = &H1
private Const SPI_SETDESKWALLPAPER = 20
'
private Sub Command1_Click()
'
Dim r as Long
'
' Replace the 'c:\winnt\winnt256.bmp' with your required file
'
Call SystemParametersInfo(SPI_SETDESKWALLPAPER, _
0&, _
"c:\winnt\winnt256.bmp", _
SPI_SETDESKWALLPAPER Or _
SPIF_UPDATEINIFILE)
'
End Sub
Note: This won't appear to work if the user has the ActiveDesktop enabled.
Chris Eastwood
CodeGuru - the website for developers
http://codeguru.developer.com/vb
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|