Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Refresh Active Desktop

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,28195
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refresh Active Desktop
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Refresh Active Desktop - 11/21/2005 3:33:46 AM   
  timboon

 

Posts: 5
Score: 0
Joined: 11/21/2005
Status: offline
Hi,

I have two copies of Active Desktop Backgrounds *.html files (displaying
active content) that are used depending on the state of the network
connection (online and offline ).

However the only way that i can get the Active Backgrounds to change
between the online and offline wallpaper is: waiting the 4 hours for the
*.html files to refresh or to lock the computer and then unlock the computer.

What I really need is some visual baisic code that can be run, after the connection
status changes to refresh the active desktop content (background), does anyone have any?

By the way we already have a program monitoring the connection status, so all we need is a command that refreshes
the active desktop content.

 
 
Post #: 1
 
 RE: Refresh Active Desktop - 11/21/2005 5:39:14 AM   
  mbouchard


Posts: 1894
Score: 14
Joined: 5/15/2003
From: USA
Status: offline
Use send keys to send f5 to the desktop.  You would probably need to send a winkey/d to make sure that the desktop is active.

_____________________________

Mike

For useful Scripting links see the Read Me First stickey!

Always remember Search is your friend.

(in reply to timboon)
 
 
Post #: 2
 
 RE: Refresh Active Desktop - 11/21/2005 6:38:26 AM   
  Snipah


Posts: 1343
Score: 6
Joined: 11/1/2004
From: Netherlands
Status: offline
Could you edit the HTML content and add <META REFRESH... to it?

_____________________________

For more information, please see the "Read me First" topic.

http://www.visualbasicscript.com

(in reply to mbouchard)
 
 
Post #: 3
 
 RE: Refresh Active Desktop - 11/21/2005 8:02:53 PM   
  timboon

 

Posts: 5
Score: 0
Joined: 11/21/2005
Status: offline
Hi,

I have used the send keys script below, gowever it did not work. 

Option Explicit
Dim WSHShell, strDesktop
Set WSHShell = WScript.CreateObject("WScript.Shell")
strDesktop = WSHShell.SpecialFolders("Desktop")
WSHShell.AppActivate strDesktop
WScript.Sleep 500
WSHShell.SendKeys "{F5}"
If err.number = 0 then
    WScript.Echo "Desktop Refreshed "
    Else WScript "Error " & err.number
    err.number = 0
End if
WScript.Quit
' End of VBScript to refresh the desktop

How do I  send a winkey/d to make sure that the desktop is active?  


(in reply to Snipah)
 
 
Post #: 4
 
 RE: Refresh Active Desktop - 11/21/2005 11:12:05 PM   
  TNO


Posts: 1072
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
quote:

How do I  send a winkey/d to make sure that the desktop is active?  


You can stop searching google 'cause I just figured it out.

There is no sendkey method for the windows key. So the alternative is to create an explorer command file:


      



There's a crazier and more lengthy way of doing this using IE's event method (keypress 91). That method is probably 10 times larger though.

< Message edited by TNO -- 11/21/2005 11:15:07 PM >


_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to timboon)
 
 
Post #: 5
 
 RE: Refresh Active Desktop - 11/22/2005 1:36:43 AM   
  timboon

 

Posts: 5
Score: 0
Joined: 11/21/2005
Status: offline
Thanks for your help, that works fine.  One final question, what are the commands to minimise and maximise all progrms?  Also, could you recommend any good VBS site with tutorials examples etc?

(in reply to TNO)
 
 
Post #: 6
 
 RE: Refresh Active Desktop - 11/22/2005 1:40:07 AM   
  timboon

 

Posts: 5
Score: 0
Joined: 11/21/2005
Status: offline
Also, does anyone know whether there is a VBS command that refreshes Windows XP.  E.g. Some settings are only applied if the user locks their computer and then unlocks it, is their a command that can be run that will do this automatically?

(in reply to TNO)
 
 
Post #: 7
 
 RE: Refresh Active Desktop - 11/22/2005 2:09:32 AM   
  TNO


Posts: 1072
Score: 10
Joined: 12/18/2004
From: thenewobjective.com
Status: offline
To minimize all programs, use this:


      

To maximize all windows...... the closest thing I can think of is:


      



You could replace UndoMinimizeAll with any of the following:

TileHorizontally
TileVertically
CascadeWindows

As for locking and unlocking, Here are options related to that subject:


      

Change this as required:

Call Shutdown(".","logoff")

Good VBS sites/tutorials:

A good reference is the microsoft scripting reference and the MSDN website:

http://msdn.microsoft.com/library/default.asp?url=/downloads/list/webdev.asp

The best community and place for samples/discussion is, believe it or not....This website in my opinion. I learned most of what I know about vbs from here.

_____________________________

To iterate is human, to recurse divine. -- L. Peter Deutsch

(in reply to timboon)
 
 
Post #: 8
 
 RE: Refresh Active Desktop - 11/22/2005 2:48:10 AM   
  timboon

 

Posts: 5
Score: 0
Joined: 11/21/2005
Status: offline
Thanks for your help, that has helped me a lot.

(in reply to TNO)
 
 
Post #: 9
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Refresh Active Desktop Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts