Desktop background

BlitzMax Forums/BlitzMax Programming/Desktop background

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

This returns garbage. What have I done wrong?
Woah! The output looks like the contents of a executable (when opened in notepad.)

SuperStrict

Framework brl.standardio
Import brl.bank

Extern "win32"
	Function SystemParametersInfo(uiAction:Int, uiParam:Int, pvParam:Byte Ptr, fWinIni:Int) = "SystemParametersInfoA@16"
	
End Extern
Const SPI_GETDESKWALLPAPER:Int = $73


Print GetWallpaper()
End

Function GetWallpaper:String()
  Local tmp_bank:TBank = CreateBank(255), returnvalue:Byte Ptr = BankBuf(tmp_bank)
	
	SystemParametersInfo(SPI_GETDESKWALLPAPER, 128, returnvalue, 0)
	
   Return String.FromCString(returnvalue)
   
End Function


There was a way of getting the value using some form of a string (cstring, wstring, short ptr to string?) but I don't remember what it was, the above works just fine.