I'm trying to write a bit of code to set the desktop background. It kind of works but I want it to stretch the image to full screen.
Much googling suggests that the code below should work... but it doesn't. It changes the background but it remains centered rather than stretched.
Strict
?Win32
Const SPI_SETDESKWALLPAPER:Int = $14
Const SPIF_SENDWININICHANGE:Int = $2
Const SPIF_UPDATEINIFILE:Int = $1
Extern "win32"
Function SystemParametersInfo(uiAction, uiParam, pvParam:Byte Ptr, fWinIni) = "SystemParametersInfoA@16"
End Extern
?
setwallpaper("paper2.jpg")
Function SetWallpaper(path:String)
SystemParametersInfo(SPI_SETDESKWALLPAPER, 0, path.toCString(), SPIF_UPDATEINIFILE | SPIF_SENDWININICHANGE)
End Function What's wrong?
|