Jump to content
Sign in to follow this  
Paulie

Wallpaper dll Call

Recommended Posts

Paulie

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

Share this post


Link to post
Share on other sites
GaryFrost

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


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites
Paulie

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

Share this post


Link to post
Share on other sites
PaulIA

; =================================================================================================
; 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

Share this post


Link to post
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
Sign in to follow this  

×