Valhalla Legends Forums Archive | C/C++ Programming | Changing desktop wallpaper

AuthorMessageTime
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.
October 5, 2007, 7:46 AM
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.
October 5, 2007, 8:10 AM
Hell-Lord
Thanks ill mess about and see how far i get :)
October 5, 2007, 8:17 AM
Hell-Lord
Any reason why it would be better to use the SystemParametersInfo instead of the IActiveDesktop class?
October 5, 2007, 9:45 AM
Camel
Just guessting, but IActiveDesktop sounds like it requires active desktop, which you should avoid like the plague.
October 5, 2007, 2:29 PM
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?
October 6, 2007, 2:55 AM
Barabajagal
Editing the registry, like I said.
October 6, 2007, 3:00 AM
BreW
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).
October 6, 2007, 3:34 AM
JoeTheOdd
[quote author=brew link=topic=17085.msg173616#msg173616 date=1191641674]
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).
[/quote]

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
October 6, 2007, 7:36 AM
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.
October 6, 2007, 9:12 PM
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?
October 6, 2007, 9:37 PM
Camel
[quote author=Andy link=topic=17085.msg173648#msg173648 date=1191705171]
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.
[/quote]

I bet it doesn't have JNI exports to work with Java!
October 7, 2007, 8:06 AM
Quarantine
And C# has native support for converting images.
October 7, 2007, 12:20 PM
St0rm.iD
[quote author=Warrior link=topic=17085.msg173677#msg173677 date=1191759652]
And C# has native support for converting images.
[/quote]

jesus christ will you cool it? it's in the c/c++ programming forum for a reason.
October 8, 2007, 5:11 AM
Quarantine
[quote author=Banana fanna fo fanna link=topic=17085.msg173700#msg173700 date=1191820305]
[quote author=Warrior link=topic=17085.msg173677#msg173677 date=1191759652]
And C# has native support for converting images.
[/quote]

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

^ lol.
[me=Warrior]points to the Java mention in this thread too[/me]

I know you like me and all, but try not to be a stalker.
October 8, 2007, 7:52 AM
St0rm.iD
[quote author=Warrior link=topic=17085.msg173707#msg173707 date=1191829947]
[quote author=Banana fanna fo fanna link=topic=17085.msg173700#msg173700 date=1191820305]
[quote author=Warrior link=topic=17085.msg173677#msg173677 date=1191759652]
And C# has native support for converting images.
[/quote]

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

^ lol.
[me=Warrior]points to the Java mention in this thread too[/me]

I know you like me and all, but try not to be a stalker.
[/quote]

I think me and you lurk in the same threads; I wasn't actually stalking you...

You and I are similar methinks.
October 8, 2007, 6:17 PM
DDA-TriCk-E
Convenient excuse for stalking  :P
October 14, 2007, 12:19 PM
St0rm.iD
Nah I was lurking this thread before. I don't have much win32 api experience, though, so I like picking up tidbits here and there.
October 15, 2007, 12:32 AM

Search