Anyone know how to get the filename of the current windo0ws wallapper? And anyone know how to change the state of the current wallpaper to strech/center/tile and update the wallpaper instantly?
THanks
Adrift
Printable View
Anyone know how to get the filename of the current windo0ws wallapper? And anyone know how to change the state of the current wallpaper to strech/center/tile and update the wallpaper instantly?
THanks
Adrift
To determine the current wallpaper's filename:
Code:Public Declare Function GetPrivateProfileString _
Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal _
lpApplicationName As String, ByVal lpKeyName As String, _
ByVal lpDefault As String, ByVal lpReturnedString As _
String, ByVal nSize As Long, ByVal lpFileName As String) As _
Long
Public Function ReadINI(strsection As String, strkey As String, strfullpath As String) As String
Dim strbuffer As String
Let strbuffer$ = String$(750, Chr$(0&))
Let ReadINI$ = Left$(strbuffer$, GetPrivateProfileString(strsection$, ByVal LCase$(strkey$), "", strbuffer, Len(strbuffer), strfullpath$))
End Function
Usage
Private Sub Command1_Click()
MsgBox ReadINI("Desktop", "Wallpaper", "C:\Windows\Win.ini")
End Sub