|
-
Oct 9th, 2000, 07:42 PM
#1
Thread Starter
New Member
I pasted the following code together from misc. bits of code all over the net. I want to add in the function so that there are three radio buttons, one set to center, one set to tile, and one set to strech the wallpaper. Any ideas?
Thanks
Adrift
---Code Pasted---
Private Const RDW_INVALIDATE = &H1
Private Const RDW_INTERNALPAINT = &H2
Private Const RDW_ERASE = &H4
Private Const RDW_VALIDATE = &H8
Private Const RDW_NOINTERNALPAINT = &H10
Private Const RDW_NOERASE = &H20
Private Const RDW_NOCHILDREN = &H40
Private Const RDW_ALLCHILDREN = &H80
Private Const RDW_UPDATENOW = &H100
Private Const RDW_ERASENOW = &H200
Private Const RDW_FRAME = &H400
Private Const RDW_NOFRAME = &H800
Private Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Private Declare Function CreateRectRgnIndirect Lib "gdi32" _
(lpRect As RECT) As Long
Private Declare Function RedrawWindow Lib "user32" _
(ByVal hwnd As Long, lprcUpdate As RECT, ByVal hrgnUpdate _
As Long, ByVal fuRedraw As Long) As Long
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
Const SPI_SETDESKWALLPAPER = 20
Const SPIF_UPDATEINIFILE = &H1
Private Sub cmdChangeWallpaper_Click()
SystemParametersInfo SPI_SETDESKWALLPAPER, 0, (Picpath & List1.Text), SPIF_UPDATEINIFILE
Dim udtScrDim As RECT
Dim lReturn As Long
Dim hRegion As Long
udtScrDim.Left = 0
udtScrDim.Top = 0
udtScrDim.Right = Screen.Width
udtScrDim.Bottom = Screen.Height
hRegion = CreateRectRgnIndirect(udtScrDim)
If hRegion <> 0 Then
lReturn = RedrawWindow(0, udtScrDim, hRegion, _
RDW_ERASE Or RDW_FRAME Or RDW_INVALIDATE Or RDW_UPDATENOW Or RDW_INTERNALPAINT Or RDW_ALLCHILDREN)
End If
End Sub
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
|