SystemParametersInfo_

Just starting out? Need help? Post your questions and find answers here.
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

SystemParametersInfo_

Post 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 :)
Kale
PureBasic Expert
PureBasic Expert
Posts: 3000
Joined: Fri Apr 25, 2003 6:03 pm
Location: Lincoln, UK
Contact:

Post 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
--Kale

Image
SoulReaper
Enthusiast
Enthusiast
Posts: 372
Joined: Sun Apr 03, 2005 2:14 am
Location: England

Post by SoulReaper »

@Kale

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

Regards
Kevin :wink:
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Post 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.
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
Post Reply