• Welcome to Valhalla Legends Archive.
 

Changing desktop wallpaper

Started by Hell-Lord, October 05, 2007, 02:46 AM

Previous topic - Next topic

Hell-Lord

Anyone aware of any good methods at doing this? I was thinking of using SetWallpaper or the SystemParametersInfo API. Is there an other suitable way?

Edit: Just to note i also have to set the picture display to either Tile, Stretch or Center.

Barabajagal

SystemParametersInfo is the way I've always done it. However, for total control, use the registry. "HKEY_CURRENT_USER\Control Panel\Desktop" has 3 important keys for you: Wallpaper, TileWallpaper, and WallpaperStyle. Experiment with them and you'll get the hang of what they do.

Hell-Lord

Thanks ill mess about and see how far i get :)

Hell-Lord

Any reason why it would be better to use the SystemParametersInfo instead of the IActiveDesktop class?

Camel

Just guessting, but IActiveDesktop sounds like it requires active desktop, which you should avoid like the plague.

brew

SystemParametersInfo seems to only accept bitmap files for desktop wallpapers. Windows desktop supports other file types too (.jpg, .gif, .png, etc) so how would I be able to make a non-bitmap image file my desktop background?
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Barabajagal

Editing the registry, like I said.

brew

#7
After closer inspection of that registry directory i have found the registry keys named "ConvertedWallpaper" and "Converted Wallpaper Last WriteTime" (a string and an 8 byte FILETIME, respectively) suggesting that the wallpaper can not be anything but a .bmp file, and anything else is converted and written to a temporary bitmap. I guess I've answered my own question.
Moral of the story: A desktop wallpaper changer is much more time-consuming and involved then it seems at first, unless it's abilities are going to be very limited (bitmap files only).
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Joe[x86]

Quote from: brew on October 05, 2007, 10:34 PM
After closer inspection of that registry directory i have found the registry keys named "ConvertedWallpaper" and "Converted Wallpaper Last WriteTime" (a string and an 8 byte FILETIME, respectively) suggesting that the wallpaper can not be anything but a .bmp file, and anything else is converted and written to a temporary bitmap. I guess I've answered my own question.
Moral of the story: A desktop wallpaper changer is much more time-consuming and involved then it seems at first, unless it's abilities are going to be very limited (bitmap files only).

I'm rather confident that the API would include a JPEG to Bitmap converter, then, if Windows uses one. If not, download a DLL from somewhere. You *know* that someone has written one. :P
Quote from: brew on April 25, 2007, 07:33 PM
that made me feel like a total idiot. this entire thing was useless.

Barabajagal

ijl11.dll is an excellent JPEG conversion DLL. I use it for a Webcam application I'm working on (which allows you to control the JPEG quality and framerate [1 to 25 FPS] of the stream you send). You can get it from http://vbaccelerator.com/ , though it works with any language.

brew

I'm thinking that the function windows uses to convert other file formats to BMP is within the dll used by Windows Fax and Picture Viewer, does anyone know the filename of this dll?
<3 Zorm
Quote[01:08:05 AM] <@Zorm> haha, me get pussy? don't kid yourself quik
Scio te esse, sed quid sumne? :P

Camel

Quote from: Andy on October 06, 2007, 04:12 PM
ijl11.dll is an excellent JPEG conversion DLL. I use it for a Webcam application I'm working on (which allows you to control the JPEG quality and framerate [1 to 25 FPS] of the stream you send). You can get it from http://vbaccelerator.com/ , though it works with any language.

I bet it doesn't have JNI exports to work with Java!

Warrior

And C# has native support for converting images.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

Banana fanna fo fanna

Quote from: Warrior on October 07, 2007, 07:20 AM
And C# has native support for converting images.

jesus christ will you cool it? it's in the c/c++ programming forum for a reason.

Warrior

Quote from: Banana fanna fo fanna on October 08, 2007, 12:11 AM
Quote from: Warrior on October 07, 2007, 07:20 AM
And C# has native support for converting images.

jesus christ will you cool it? it's in the c/c++ programming forum for a reason.

^ lol.
* Warrior points to the Java mention in this thread too

I know you like me and all, but try not to be a stalker.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?