The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: georgek01 on November 27, 2009, 08:28:04 PM

Title: SystemParametersInfo & screen flicker
Post by: georgek01 on November 27, 2009, 08:28:04 PM
Hello!

I'm using SystemParametersInfo with SPI_SETDESKWALLPAPER to automatically set a different wallpaper image every few minutes. SystemParametersInfo causes the screen to flicker though. I assume it's because this function notifies all windows that a system wide parameter has changed so they need to repaint.

I also change the desktop color to the color of the first pixel [0,0] of the image.

Is there perhaps a way of changing the wallpaper image and desktop color without the flicker?



WM_TIMER

; get path of new image and store as szImagePath
invoke SystemParametersInfo,SPI_SETDESKWALLPAPER,0,addr szImagePath,00h

; get color of first pixel of image and set desktop color
invoke SetSysColors,1,addr aSystem,addr aColor