Wallchangers

Hi
I search for a long time a way to solve this issue.
In fact, in all wallchangers (objects/widgets) i have checked out there is the same mater.
When you click on them to change the wall often you need to press F5 or to go in display properties to refresh the wallpaper on desktop. that's su*censored* a lot.
If there somebody who can help me to solve this.

PS: i have try also with the Omni wallchanger by Tiggz and it's the same....
8,811 views 24 replies
Reply #2 Top
Hi Dear Erk maybe i haven't explain well the mater here
I'm sorry your link it's really interesting but i'm care about script for widget not for a wallchanger i have mine and it's good the only mater is refreshing...
I talk about widget scripting.
In all Wallchanger (WIDGET/OBJECT) there the same problems with the refreshing and i'm wondering if there are here a guy who know a way to solve this.
Reply #3 Top
This worked for me.

' Refresh the desktop to remove the deleted shortcuts correctly
set oShell = createobject("shell.application")
set oDesktop = oShell.Namespace(0)

oDesktop.self.invokeVerb "R&efresh"
set oShell = Nothing
set oDesktop = Nothing

Found it here JTB World Blog
Reply #4 Top
Thanks SirSmiley i'll try this now!
Reply #5 Top
No probs Quentin ...thats why I said "Might help"

wasn't sure what you wanted
Reply #6 Top
You're Welcome!

I wanted that a while back for another reason.

PS. Found another Key Script at visualbasicscript.com

Option Explicit
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WSHShell.SendKeys "{F5}"
WScript.Quit
Reply #7 Top
Nice job SirSmiley
Reply #8 Top
Thanks Z!

Here's another one from that same thread at visualbasicscript.com.

Direct Link to the thread


Set WApp = CreateObject("Shell.Application")
WApp.Namespace(0).Self.InvokeVerb "Refresh"

Incidentally, I found that by typing vbscript refresh desktop into Google
Reply #9 Top
Thanks you so much SirSmiley and i agree with Zubaz good job
Next time i'll try google like you i' haven't think at it
here the code i have made in regards at all you show me
I must changed and reworked all cause i can't get your code to work why i don't know tell me if that run for you?
here the code:

Sub Object_OnStateChange(state)
If state = "Command executed" Then
On Error Resume Next
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "{F5}"
Set WSHShell = nothing
End If
End Sub

if that run also for you that's cool and i have just to included it in the wallchanger code.
hope i'm clear and that mean something

EDIT: *Censured* that's run fine in DX and when DX is unload not....


Reply #10 Top
Set WSHShell = WScript.CreateObject("WScript.Shell")

Should be
Set WSHShell = CreateObject("WScript.Shell")
Reply #11 Top
I try i try but not it's the same that's works on DX but as soon as DX is Unload That isn't work at all...
I'm wondering really
Reply #13 Top
There are limitations to what DX can do directly with the system, this is for security reasons. You may need to put it into an external script then call it using the run or exec command.

Create an external vbs file call it refreshscript.vbs
Place this code in the file:

'SendKeys script to refresh desktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
WSHShell.SendKeys "{F5}"
Set WSHShell = nothing

Add it to your object as a custom file

This should be the code to run it.

Sub Object_OnStateChange(state)
If state = "Command executed" Then
On Error Resume Next
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "refreshscript.vbs"
End If
End Sub

This worked for me
Reply #14 Top

BUMP!

Hey,
Had to write & test it, Give me some time man!
Reply #15 Top

Hey,
Had to write & test it, Give me some time man!


SO sorry it's just i hate when i can't make a thing thank you so much for the time you take for this problems i'll try this and i tell you
Reply #16 Top
I understand and know the feeling!

FYI On a positive note this might be an easier way to run command line applications for all those interested?
Reply #17 Top
Ok That's refresh icons on desktop but not the wall...

And yes it could be help some people
Reply #18 Top
Clear your cache & try it? Because it's not working for me on a clean start. If that's the case then a MoveFile or Copyfile command might need to be added?

Ok That's refresh icons on desktop but not the wall


Got to do some errands; so, not able to look into this until later. Maybe try a google search for "vbscript refresh wallpaper"?

Reply #19 Top
Why not use the System Namespace callbacks from the manual? It does this all automatically! Just wondering.

DesktopX Manual


System.SetWallpaper

This allows you to specify the Windows wallpaper. You need to provide a full path to the wallpaper and then an option to feine how to display the wallpaper.
Option:

0 = use default wallpaper
1 = Center wallpaper
2 = Tile wallpaper
3 = Stretch wallpaper

Examples:

System.SetWallpaper "C:\temp\wall1.bmp", 1
System.SetWallpaper Object.Directory & "wall1.jpg", 1
System.SetWallpaper "", 0 This will restore the original wallpaper.

Reply #20 Top
winjpg = windowspath & "\q94wallpaper12.jpg"
System.SetWallpaper winjpg,3

the code i already use


An idea maybe make a script who call a shortcut.
and shortcut call F5
I need only to know the .dll who admin the function keys or refreshing of screen and subdll to make that
i'll go to search that
Reply #21 Top
Hi Quentin,

here is the way to change wallpapers with user32.dll:

Dim wp

Set objShell = CreateObject("WScript.Shell")
wp = "the path to your wallpaper"
objShell.regwrite "HKCU\Control Panel\Desktop\Wallpaper", wp
objShell.Run "%windir%\System32\RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters", 1, True
Set objShell = nothing
Reply #22 Top
Very interesting thread!
Though, I never had the problem you are mentioning Quentin94, never happens if the file is in .jpg format, maybe it happens with other file formats... just my 2 cents
Reply #23 Top
I use .jpg adni and could you tell me witch wallchanger you use please maybe that could help me
and for Vad_M thanks i'll check that today or tomorrow
Reply #24 Top
Ok it's not fine i have tried some wallchangers and others code like the wallchangers tutorial by RomanDA and it still the same all runs good when you are with DX open but when DX is closed all widgets and gadgets no runs good.
Shortcuts (Dx normals shortcuts-> right click-> "select the target") not runs, you can't select the target.
wallchangers not runs too they keep wallpapers you select but not apply them the last wall still stay and you need to press F5 (when that's runs) or lock unlock the taskbar.
It appear here at less that certain function or code create/use in DX builder or DX not runs in widgets or gadgets.
For example the wallchanger code by RomanDA run really good on an object or theme but not in widget or gadget. There is anybody who get the same mater?