Sign in to follow this  
Followers 0
toonboon

Refresh Desktop.

21 posts in this topic

I need to refresh my desktop without closing explorer.exe

I am trying to change the desktop folder, I did this through a registry key, but for the change to happen, I need to restart explorer.exe. Is there another way to do this?


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites



Have you tired the EnvUpdate( ) function?

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

I did just now, and it doesn't work. thanks anyways.

Edited by toonboon

[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

I did just now, and it doesn't work. thanks anyways.

F5 refresh all windows so have you tried :

send("{F5}")

 

OS : Win XP SP2 (32 bits) / Win 7 SP1 (64 bits) / Win 8 (64 bits) | Autoit version: latest stable / beta.
Hardware : Intel(R) Core(TM) i5-2400 CPU @ 3.10Ghz / 8 GiB RAM DDR3.

My UDFs : Skype UDF | TrayIconEx UDF | GUI Panel UDF | Excel XML UDF | Is_Pressed_UDF

My Projects : YouTube Multi-downloader | FTP Easy-UP | Lock'n | WinKill | AVICapture | Skype TM | Tap Maker | ShellNew | Scriptner | Const Replacer | FT_Pocket | Chrome theme maker

My Examples : Capture toolIP Camera | Crosshair | Draw Captured Region | Picture Screensaver | Jscreenfix | Drivetemp | Picture viewer

My Snippets : Basic TCP | Systray_GetIconIndex | Intercept End task | Winpcap various | Advanced HotKeySet | Transparent Edit control

 

Share this post


Link to post
Share on other sites

F5 refresh all windows so have you tried :

send("{F5}")
this is better:

ControlSend('Program Manager', '', '', '{F5}')

Share this post


Link to post
Share on other sites

This just refreshes it. I need to reload the entire data in the desktop, since the folder has changed. The entire path has changed. F5 doesn't accomplish this, I already tried that a 100 times.


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

You probably have to restart explorer because it won't know to look for a new value. I'm sure it's written that way for a reason.

It's not hard to ProcessClose("explorer.exe") Run("explorer.exe").

Share this post


Link to post
Share on other sites

I know it's not hard. I don't even need to insert the Run("explorer.exe") code. But I don't like the fact that when closing explorer.exe I can't use the taskbar for about 3 seconds, AND all open folder windows close.


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

so save all folder windows to an array and reopen them apon reload of explorer


Giggity

Share this post


Link to post
Share on other sites

Yes I already thought of that, implemented it already, but I'm just not happy with the five second delay it brings into my work.


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

If this can be accomplished without restarting explorer, it will most likely be using _SendMessage. Now as to what message and what window...I haven't a clue.

Share this post


Link to post
Share on other sites

Try this:

$Hwnd = WinGetHandle("classname=Progman")
DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0)

Share this post


Link to post
Share on other sites

Try this:

$Hwnd = WinGetHandle("classname=Progman")
 DllCall("user32.dll", "long", "SendMessage", "hwnd", $hWnd, "int", 0x111, "int", 28931, "int", 0)
No, that is not working. And the code I have so far is relatively simple.

$RegKeyFolder = "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\"
$Folder = FileSelectFolder("Select a folder to use as desktop...","My computer")
RegWrite($RegKeyFolder,"Desktop","REG_EXPAND_SZ", $Folder)
ProcessClose("explorer.exe")
WinMinimizeAll()

[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

I need to refresh my desktop without closing explorer.exe

I am trying to change the desktop folder, I did this through a registry key, but for the change to happen, I need to restart explorer.exe. Is there another way to do this?

Hmm... maybe this will helps?

Const $WM_SETTINGCHANGE = 0x001A
Const $HWNDBROADCAST = 0xFFFF
Const $szParam = "Environment"

DllCall("user32.dll", "int", "SendMessage", _
                             "hwnd", $HWNDBROADCAST, _
                             "int", $WM_SETTINGCHANGE, _
                             "int", 0, _
                             "int", $szParam)

Run("rundll32 user32.dll,UpdatePerUserSystemParameters")

Share this post


Link to post
Share on other sites

Nope, thanks for the try though =).. I'm beginning to think that closing explorer.exe is the only way..

There must be some way around it though...


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

There isn't always a way around it. How many programs do you know of that will check for settings updates at runtime? They usually don't unless they have a settings window for you to use.

Share this post


Link to post
Share on other sites

Ok, I understand this, but I feel like there must be some way around this... Can't I make explorer.exe recheck those values?

Not that this is a big problem for the functionality of my script, it's just something I'd like to have perfectioned.


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

If the above "update" methods didn't work, I doubt there is a way to do it.

Share this post


Link to post
Share on other sites

Ok, thanks for the help anyways, but I will not stop my search for a solution that easily. I will continue to search for a way to solve my problem.


[right]~What can I say, I'm a Simplistic person[/right]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0