|
-
Nov 17th, 2009, 03:51 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] desktop background
is it possible to change the desktops background with vb6, and how?
-
Nov 17th, 2009, 04:08 PM
#2
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Nov 17th, 2009, 10:14 PM
#3
Addicted Member
Re: desktop background
You can use the SystemParametersInfo API function. The first parameter is set to 20, the second parameter is set to 0, the third parameter is the path and filename of your bitmap image and the final parameter is set to 0 if you don't want the changes to survive a reboot and 1 if you do.
Code:
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
Private Sub ChangeWallpaper(BMPfilename As String, UpdateRegistry As Boolean)
On Error GoTo MyErr
If UpdateRegistry Then
SystemParametersInfo 20, 0, BMPfilename, 1
Else
SystemParametersInfo 20, 0, BMPfilename, 0
End If
Exit Sub
MyErr:
MsgBox "oops... " & Err.Description
End Sub
Private Sub Command1_Click()
' This won't survive a reboot
ChangeWallpaper App.Path & "\wallpaper.bmp", False
End Sub
Private Sub Command2_Click()
' This will permanently change the wallpaper
ChangeWallpaper App.Path & "\wallpaper.bmp", True
End Sub
-
Nov 18th, 2009, 04:00 AM
#4
Thread Starter
Fanatic Member
Re: desktop background
i like how you can choose wether it should be permenant or not thanks works.
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
|