Jump to content

Refresh Desktop.


toonboon
 Share

Recommended Posts

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]

Link to comment
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]

Link to comment
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]

Link to comment
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]

Link to comment
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")
Link to comment
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]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...