Jump to content
Sign in to follow this  
laojikelly

How to simulate as Refresh ?

Recommended Posts

laojikelly

Hello everyone!

How to simulate as Refresh ?

I think I'm bad for English.And that I have a question.

I want to hide a file and through the regedit.But I'm fail.It must Manual Refresh,the file can't be hide at once.

I try many many ways to try it.Please Help me! Thanks.

code:

RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "reg_dword", "2")

fail:

DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")

DllCall("user32.dll","int","SendMessageTimeout","hwnd",65535,"int",26,"int",0,"int",0,"int",0,"int",1000,"str","dwResult")

Run ("RunDll32.exe USER32.DLL,UpdatePerUserSystemParameters")

Send("{f5}")

=================================================================================================================================

Func _Refreshicon()
    FileWriteLine(@TempDir & "\Refreshicon.inf","[version]" & @CRLF & "signature=$chicago$")
    RunWait ('Rundll32.exe setupapi,InstallHinfSection DefaultInstall 132 '& @TempDir & "\Refreshicon.inf",@TempDir,@SW_HIDE)
    FileDelete (@TempDir & "\Refreshicon.inf")
    Return 1
EndFunc

=================================================================================================================================

=================================================================================================================================

Func _RefreshIconMSG()
    DllCall("shell32.dll", "none", "SHChangeNotify", _
            "long", 0x8000000, _
            "uint", BitOR(0x0, 0x1000), _
            "ptr", 0, _
            "ptr", 0 _
            )
    Return 1
EndFunc

=================================================================================================================================

OK:

MouseClick("right")
[code]Send("{e}")
;but i don't want it.

=======================================

Do 
        ProcessClose("explorer.exe")
Until Not ProcessExists("explorer.exe")
Run("gpupdate /force","",@SW_HIDE)

=======================================

;but i don't want it.

Share this post


Link to post
Share on other sites
Yashied
laojikelly

thank you very much!!!

thank you very much!!!

Func _Update_Explorer()
    Local $bOld = Opt("WinSearchChildren", True)
    Local $a = WinList("[CLASS:SHELLDLL_DefView]")
    For $i = 0 To UBound($a) - 1
        DllCall("user32.dll", "long", "SendMessage", "hwnd", $a[$i][1], "int", 0x111, "int", 28931, "int", 0)
    Next
    Opt("WinSearchChildren", $bOld)
EndFunc;==>_Update_Explorer

Thanks for your help!!

Share this post


Link to post
Share on other sites
laojikelly

Please close the topic,I'm bad for English. I'm sorry.

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.