Blackened - 24 Dec. 2004 - 11:15:

WPChanger

Here is a little compiled script (it's an exe file) I whipped up to automate the changing of wallpapers. "Why?" you may ask, because I got tired of opening the display settings dialog everytime I wanted to change my wallpaper. Now I use ContextAware to send some commandline arguments to wpchanger.exe and it does it all for me.

To use:

wpchanger.exe "x:\path\to\wallpaper\or\html\file" "file extension without the dot" "style to display"


Example:

wpchanger.exe "c:\program files\mywallpaper.bmp" "bmp" "stretch"


Or:

wpchanger.exe "c:\program files\myActiveDesktop.html" "html"


Via ContextAware menu file (for images):

>Set as Wallpaper
->Center, '"wpchanger.exe" "%path%" "%ext%" "center"'
->Tile, '"wpchanger.exe" "%path%" "%ext%" "tile"'
->Stretch, '"wpchanger.exe" "%path%" "%ext%" "stretch"'

For HTML documents:

>Set as Wallpaper, '"wpchanger.exe" "%path%" "%ext%"'


Here is a screenshot.

This has only been tested on 2k, and I make no promises that it will work at all on anyone else's system but mine, but give it a shot anyway.

Enjoy
 
24 Dec. 2004 - 11:24 saunders
Handy. Better than my IrfanView example too cus you can do HTML files as well.
Nice work man.
 
24 Dec. 2004 - 11:26 Blackened
Thank you Sir.
 
24 Dec. 2004 - 19:30 Zeratul
Neat proggie. Where do we place the context aware menu file ? (and what extension should the file have)
 
25 Dec. 2004 - 05:18 saunders
Hey neat, you made this with AutoIt. Would you be able to show me the source so I can understand how you made it work?
 
25 Dec. 2004 - 12:41 plastic
Wait a sec. Does this mean I can use this to hop from one active desktop html file to another, much like Serenity did with the styleswitcher ? I'll have to try this.
 
27 Dec. 2004 - 06:03 Blackened
Zeratul:
Context Aware menu files always have a regular txt extension that is pointed to by the file matches.txt. All is explaned in the Context Aware documentation.

Saunders:
All I did was checked the commandline arguments, matched with if statements, set a registry key, and then applied the changes by hijacking the display settings dialog, moving it offscreen, then using send() to set the center/tile/stretch property and hit apply. I'll post the source later if you still want it though.

Plastic:
Yes, you could do that.
 
27 Dec. 2004 - 14:13 plastic
I figured ;), tried it yesterday. Doesn't work (XP) when called from within .html, gives an error. Does work for images, and it worked somewhat when I ran it from a shortcut for .html. Seems XP differs a little in the way it adds html content to desktop. Well, has two ways, technically, browse for a wallpaper and choose an .html file instead, or using the desktop tab, customize button, web tab of dialog. Second way, you don't see the .html file in preview on desktop tab, or in list of files. Not really important, but wpchanger changed it there, and suddenly I found the .html being copied inside E:\Documents and Settings\Luuc\Application Data\Microsoft\Internet Explorer\Desktop.htt, resulting in script errors (probably just paths not being correct)... I never had that file get in way before.

Anyway, I'm feeling really dumb (I am), all I was thinking about was to switch to another .html file on desktop by linking this app some way. While I can just link that file itself...
 
31 Dec. 2004 - 14:55 Blackened
Plastic:
Try making a batch file with the commandline string in it, then link to that from your html file. Should work that way.
 
02 Jan. 2005 - 01:50 saunders
@Blackened:
Ahh, I was wondering how you got the changes to apply right away. I figured if you opened the display properties I would have seen something, but I didn't. Neat idea.
 
02 Jan. 2005 - 02:27 Blackened
It was kindof a last-ditch workaround.

To refresh the desktop:
If Active Desktop is turned off, then all you have to do is set the proper reg keys and run
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters
But with AD turned on this doesn't work.

Also, I never could get the center/tile/stretch reg keys to do anything in
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Desktop\General
or
HKEY_CURRENT_USER\Control Panel\Desktop
So using the dialog was a way to accomplish both.

Plastic:
If the tab order for the Display Settings dialog is different in XP, then I could easily throw some OS checks in. Since I don't have an XP system to test it on I had to just go with what I knew.
 
06 Jan. 2005 - 03:01 saunders
I took a couple screenshots with some info for you, seeing as you don't have an XP system to test with. Hopefully it's enough. If you need anything more, I'll be able to help.

Desktop Properties XP
 
09 Jan. 2005 - 09:32 Blackened
Thanks for the help saunders. Should work with XP now as long as background is the second tab in the dialog. Same download url.
 
Please log-in to post.
You need to be logged in to post. To log-in, or to register an account go -there.
 
Options
Login | Help | Profile | User list | Display last  
 days 



xhtml 1.1