ArifDigitalLab Posted May 21, 2008 Share Posted May 21, 2008 hi , i want to refresh the explorer to let the settings change effect. but the problem is that i want to set time for it . here is the code which i am using for refreshing the explorer . _UpdateExplorer() Func _UpdateExplorer() Local $aWinFViewExpListArr = _ExplFViewWinGetList() If IsArray($aWinFViewExpListArr) Then For $i = 1 To $aWinFViewExpListArr[0] WinActivate($aWinFViewExpListArr[$i]) ControlSend($aWinFViewExpListArr[$i], "FolderView", "", "{F5}") Next EndIf Local $aWinExpListArr = _ExplWinGetList() Local $hDll = DllOpen("user32.dll") If $hDll = -1 Then MsgBox(16, "Error", "There was an error to refresh explorer." & @LF & _ "This can caused by the memory full, and also you might want to check file user32.dll (in your system dir), " & @LF & _ "it must exists for this operation." & @LF & @LF & _ "You can refresh the explorer windows by pressing F5 key in each needed window," & @LF & _ "or call the context menu of the folder (SHIFT F10), and click on 'Refresh' item." & @LF & _ "OK ---> EXIT") Exit EndIf If IsArray($aWinExpListArr) Then For $i = 1 To $aWinExpListArr[0] DllCall($hDll, "long", "SendMessage", "hwnd", $aWinExpListArr[$i], "int", 0x111, "int", 28931, "int", 0) Next EndIf DllClose($hDll) EndFunc but how can i set the time for it ? for example if i want to refresh the explorer every 10 minutes. thanks! Link to comment Share on other sites More sharing options...
sandin Posted May 21, 2008 Share Posted May 21, 2008 this should work: $time = 10 ;minutes $timer = TimerInit() Func _UpdateExplorer() Local $aWinFViewExpListArr = _ExplFViewWinGetList() If IsArray($aWinFViewExpListArr) Then For $i = 1 To $aWinFViewExpListArr[0] WinActivate($aWinFViewExpListArr[$i]) ControlSend($aWinFViewExpListArr[$i], "FolderView", "", "{F5}") Next EndIf Local $aWinExpListArr = _ExplWinGetList() Local $hDll = DllOpen("user32.dll") If $hDll = -1 Then MsgBox(16, "Error", "There was an error to refresh explorer." & @LF & _ "This can caused by the memory full, and also you might want to check file user32.dll (in your system dir), " & @LF & _ "it must exists for this operation." & @LF & @LF & _ "You can refresh the explorer windows by pressing F5 key in each needed window," & @LF & _ "or call the context menu of the folder (SHIFT F10), and click on 'Refresh' item." & @LF & _ "OK ---> EXIT") Exit EndIf If IsArray($aWinExpListArr) Then For $i = 1 To $aWinExpListArr[0] DllCall($hDll, "long", "SendMessage", "hwnd", $aWinExpListArr[$i], "int", 0x111, "int", 28931, "int", 0) Next EndIf DllClose($hDll) EndFunc While if TimerDiff($timer) >= $time*60000 Then _UpdateExplorer() $timer = TimerInit() EndIf Sleep(10) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
ArifDigitalLab Posted May 21, 2008 Author Share Posted May 21, 2008 @ sandinthanx a ton for the great support help and reply !but it is giving errorWhileWhile^ERRORError: Error in expression.---------i could not understand how to solve this problem.will u please tell me what to do now ?Thanx again. Link to comment Share on other sites More sharing options...
BrettF Posted May 21, 2008 Share Posted May 21, 2008 look it up in the helpfile. Since we want it to potentially never end, While 1 should do the job . Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
sandin Posted May 21, 2008 Share Posted May 21, 2008 lol yeah, I forgot "1" ^^ Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
ArifDigitalLab Posted May 21, 2008 Author Share Posted May 21, 2008 but i still could not understand .... can you please give a example ( i am newbie in this situation ) thanx ! Link to comment Share on other sites More sharing options...
sandin Posted May 21, 2008 Share Posted May 21, 2008 While 1 if TimerDiff($timer) >= $time*60000 Then _UpdateExplorer() $timer = TimerInit() EndIf Sleep(10) WEnd Some cool glass and image menu | WinLIRC remote controler | Happy Holidays to all... | Bounce the sun, a game in which you must save the sun from falling by bouncing it back into the sky | Hook Leadtek WinFast TV Card Remote Control Msges | GDI+ sliding toolbar | MIDI Keyboard (early alpha stage, with lots of bugs to fix) | Alt+Tab replacement | CPU Benchmark with pretty GUI | Ini Editor - Edit/Create your ini files with great ease | Window Manager (take total control of your windows) Pretty GUI! | Pop-Up window from a button | Box slider for toolbar | Display sound volume on desktop | Switch hotkeys with mouse scroll Link to comment Share on other sites More sharing options...
ArifDigitalLab Posted May 21, 2008 Author Share Posted May 21, 2008 thanks bro , it is working fine and compiled exe is also giving no error but when i checks its syntrex it gives some errors . Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now