Jump to content

Wallpaper dll Call


Paulie
 Share

Recommended Posts

Could somebody please tell me if I am using this .dll correctly to change the desktop wallpaper?

It's really confusing me...

$i_image1 = "C:\WINDOWS\Web\Wallpaper\Bliss.jpg"
(DllCall Removed due to its horribly blatant wrongness)

Don't laugh at me if this is horrible :"> , I have no idea how to do this correctly

I got my info from here:

http://msdn.microsoft.com/library/default....ametersinfo.asp

http://msdn.microsoft.com/coding4fun/inthe...er/default.aspx

Someone help me figure this out please

Edited by Paulie
Link to comment
Share on other sites

Suggest searching for SystemParametersInfo here on the forum, be suprised what you'll find.

Thanks, I found the Dll i needed(I was no where Close! :lmao: ), however, I really wish to become more acquainted with dlls, so do you think someone could explain to me in layman's terms what this is doing.

Just so i have some remote understanding and am not just blindly CnPing?

DllCall("user32","int","SystemParametersInfo","int",20,"int",0,"str",$PathToImage,"int",0)
Edited by Paulie
Link to comment
Share on other sites

; =================================================================================================
; Global Constants
; =================================================================================================
Global Const $SPI_SETDESKWALLPAPER = 20
Global Const $SPIF_SENDCHANGE      = 2

; =================================================================================================
; Main
; =================================================================================================
_SetDesktopWallpaper("C:\Windows\Web\Wallpaper\Bliss.bmp")

Exit

; =================================================================================================
; Description ..: Sets the desktop wallpaper to the BMP file passed in.
; Parameters ...: $sBMPFile     - Full path to the BMP file
;                 $bUpdate      - Specifies whether the user profile is to be updated. If True, the
;                   WM_SETTINGCHANGE message is broadcast to all top level windows to  notify  them
;                   of change.
; Return values : True
;                 False
; =================================================================================================
Func _SetDesktopWallpaper($sBMPFile, $bUpdate=True)
  Local $aResult
  Local $iWinIni = 0

  if $bUpdate then $iWinIni = $SPIF_SENDCHANGE
  $aResult = DllCall("user32.dll", "int", "SystemParametersInfo", "int", $SPI_SETDESKWALLPAPER, _
                     "int", 0, "str", $sBMPFile, "int", $iWinIni)
  Return $aResult[0] <> 0
EndFunc

Auto3Lib: A library of over 1200 functions for AutoIt
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...