Results 1 to 2 of 2

Thread: How to get filename of current set wallpaper

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2000
    Posts
    12
    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

  2. #2
    Guest
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width