Page 1 of 1

SystemParametersInfo_

Posted: Tue Aug 08, 2006 7:11 pm
by SoulReaper
Hello

I have been trying to get the desktop picture name the correct way,
using SystemParametersInfo_ according to MSDN

http://msdn.microsoft.com/library/defau ... rsinfo.asp

Code: Select all

      Get_DeskTop_WallPaper=AllocateMemory(#MAX_PATH+1)
      SystemParametersInfo_(#SPI_GETDESKWALLPAPER, #MAX_PATH, *Get_DeskTop_WallPaper, 0)
      Debug PeekS(Get_DeskTop_WallPaper)
Please Note : I am using windows 2000 pro sp4 and I can set the wallpaper ok...

I suppose I could always get it from the Registry as a last resort...

P.S. I am using Bitmaps

Regards
Kevin :)

Posted: Tue Aug 08, 2006 7:37 pm
by Kale

Code: Select all

DeskTopWallPaper.s = Space(#MAX_PATH)
SystemParametersInfo_(#SPI_GETDESKWALLPAPER, #MAX_PATH, @DeskTopWallPaper, 0)
If DeskTopWallPaper
	Debug DeskTopWallPaper
Else
	Debug "No wallpaper found."
EndIf

Posted: Tue Aug 08, 2006 7:52 pm
by SoulReaper
@Kale

Thankyou for your help, I was so close :) :lol: :roll: :wink:

Regards
Kevin :wink:

Posted: Tue Aug 08, 2006 9:52 pm
by PB
Just a side-note to all this: Windows NT can return "(None)" as the name if
you have no wallpaper displayed. Something to be aware of.