forumghost Posted April 6, 2009 Share Posted April 6, 2009 Title says it all, I want to modify the registry under Microsoft/Windows/Explorer/Advanced to change some "folder options", the problem is that explorer won't update to those new settings. For example if I go into folder options and change the option to show all hidden files and folders, explorer will somehow update itself and then show these folders. But not when I go into the registry and change the key myself. How do you force explorer to update itself with the new settings? Thanks Link to comment Share on other sites More sharing options...
DaRam Posted April 6, 2009 Share Posted April 6, 2009 Get focus of Explorer window and Send F5 (Refresh). Link to comment Share on other sites More sharing options...
forumghost Posted April 6, 2009 Author Share Posted April 6, 2009 Get focus of Explorer window and Send F5 (Refresh)."Refresh view" F5 doesn't work. The explorer must refresh ITSELF to overtake the new settings. Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 Title says it all, I want to modify the registry under Microsoft/Windows/Explorer/Advanced to change some "folder options",the problem is that explorer won't update to those new settings. For example if I go into folder options and change the option to show all hidden files and folders,explorer will somehow update itself and then show these folders. But not when I go into the registry and change the key myself.How do you force explorer to update itself with the new settings?ThanksTell me please, what exactly do you change the settings in the registry and how Windows. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Dougiefresh Posted April 6, 2009 Share Posted April 6, 2009 (edited) I found this code somewhere on this forum. It was a long while ago and I don't remember who posted it. Func _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf Opt("WinTitleMatchMode", 4) $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) EndFunc ;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc ;==>_ExplWinGetList Edited April 6, 2009 by Dougiefresh Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 (edited) I found this code somewhere on this forum. It was a long while ago and I don't remember who posted it. Func _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf Opt("WinTitleMatchMode", 4) $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) EndFunc;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc;==>_ExplWinGetListThis works fine for me. What have you changed in the registry? Edited April 6, 2009 by Yashied My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
forumghost Posted April 6, 2009 Author Share Posted April 6, 2009 (edited) Doesn't work for me, crashes AutoIt when I call the update func? expandcollapse popupFunc _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf Opt("WinTitleMatchMode", 4) $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) EndFunc;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc;==>_ExplWinGetList $var = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden") $var2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt") if $var == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "2") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "1") endif if $var2 == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "0") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "1") endif ;quit Macro is designed to switch the view of hidden files and file extensions on and off with one execution of this prog. Edited April 6, 2009 by forumghost Link to comment Share on other sites More sharing options...
DaRam Posted April 6, 2009 Share Posted April 6, 2009 That is why Search is your friend http://www.autoitscript.com/forum/index.ph...ow+hidden+files Macro is designed to switch the view of hidden files and file extensions on and off with one execution of this prog. Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 Doesn't work for me, crashes AutoIt when I call the update func? expandcollapse popupFunc _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf Opt("WinTitleMatchMode", 4) $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) EndFunc;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc;==>_ExplWinGetList $var = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden") $var2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt") if $var == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "2") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "1") endif if $var2 == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "0") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "1") endif ;quit Macro is designed to switch the view of hidden files and file extensions on and off with one execution of this prog. This also works fine for me. I work in Windows XP SP2, AutoIt 3.3.0.0. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
forumghost Posted April 6, 2009 Author Share Posted April 6, 2009 This also works fine for me. I work in Windows XP SP2, AutoIt 3.3.0.0.Some rare times it updates the explorer, but 90% of the time it doesn't, I'm kinda confused Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 Doesn't work for me, crashes AutoIt when I call the update func?You contradict himself. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Valik Posted April 6, 2009 Share Posted April 6, 2009 I thought I explained this once before but apparently not. This is from a shell extension I wrote. Convert it to AutoIt yourself: void CSuperHidden::RefreshShell(HWND hWnd) const { // Sending the WM_COMMAND message with ID 0x00007103 to // SHELLDLL_DefView seems to refresh Explorer correctly. No other // command seems to work. The logical solution would be to send // the ID of the Refresh menu item, but that doesn't work. This ID // was found with Spy++ when the context-menu Refresh is selected. HWND hRefresh = FindWindowEx(hWnd, NULL, _T("SHELLDLL_DefView"), _T("")); if (hRefresh) PostMessage(hRefresh, WM_COMMAND, 0x00007103, 0); } // RefreshShell() Link to comment Share on other sites More sharing options...
KaFu Posted April 6, 2009 Share Posted April 6, 2009 (edited) CabinetWClass seems wrong, more ExploreWClass? _Update_Explorer() Func _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) ConsoleWrite($Hwnd & @crlf) $Hwnd = ControlGetHandle($Hwnd, "", "[CLASS:SHELLDLL_DefView; INSTANCE:1]") ConsoleWrite($Hwnd & @crlf) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf $Hwnd = WinGetHandle("classname=Progman") DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) EndFunc;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=ExploreWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][1] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc;==>_ExplWinGetList Edit: Ts, always double check... there was an array in supplied example above... the $WinListArr[$iW] = $WinList[$iW][0] has to be $WinListArr[$iW] = $WinList[$iW][1] And for the books: $aResult = DllCall("User32.dll", "hwnd", "FindWindowEx", "hwnd", $Hwnd, "int", 0, "str", "SHELLDLL_DefView", "str", "") ConsoleWrite($aResult[0] & @crlf) is the exact translation of the call Valik provided, though $Hwnd = ControlGetHandle($Hwnd, "", "[CLASS:SHELLDLL_DefView; INSTANCE:1]") ConsoleWrite($Hwnd & @crlf) returns exactly the same handle. Edited April 6, 2009 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 Try this... for me it seems to work , searched this one for ages, thanks Valik for pointing in the right direction (in fact pushing my nose into it , apologies for my too quick first answer). _Update_Explorer() Func _Update_Explorer() Local $WinExpListArr, $GetWinState, $Hwnd $WinExpListArr = _ExplWinGetList() If IsArray($WinExpListArr) Then For $iWin = 1 To $WinExpListArr[0] $GetWinState = WinGetState($WinExpListArr[$iWin]) $Hwnd = WinGetHandle($WinExpListArr[$iWin]) ;ConsoleWrite($Hwnd & @crlf) $Hwnd = ControlGetHandle($Hwnd, "", "[CLASS:SHELLDLL_DefView; INSTANCE:1]") ;ConsoleWrite($Hwnd & @crlf) DllCall("user32.dll", "long", "SendMessage", "hwnd", $Hwnd, "int", 0x111, "int", 28931, "int", 0) Next EndIf EndFunc;==>_Update_Explorer Func _ExplWinGetList() Local $WinList, $iW Opt("WinTitleMatchMode", 4) $WinList = WinList("classname=CabinetWClass") If IsArray($WinList) Then Local $WinListArr[$WinList[0][0] + 1] For $iW = 1 To $WinList[0][0] $WinListArr[$iW] = $WinList[$iW][0] Next $WinListArr[0] = $WinList[0][0] Return $WinListArr Else Return "" EndIf EndFunc;==>_ExplWinGetListWhy have you removed the refresh for desktop? My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
KaFu Posted April 6, 2009 Share Posted April 6, 2009 (edited) Why have you removed the refresh for desktop?Hmmm, good question , added again.Anyone knows what is and where to find CabinetWClass? I can only find ExploreWClass (which seems to work). Edited April 6, 2009 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Yashied Posted April 6, 2009 Share Posted April 6, 2009 Anyone knows what is and where to find CabinetWClass? I can only find ExploreWClass (which seems to work).With "ExploreWClass" not works for me. My UDFs: iKey | FTP Uploader | Battery Checker | Boot Manager | Font Viewer | UDF Keyword Manager | Run Dialog Replacement | USBProtect | 3D Axis | Calculator | Sleep | iSwitcher | TM | NetHelper | File Types Manager | Control Viewer | SynFolders | DLL Helper Animated Tray Icons UDF Library | Hotkeys UDF Library | Hotkeys Input Control UDF Library | Caret Shape UDF Library | Context Help UDF Library | Most Recently Used List UDF Library | Icons UDF Library | FTP UDF Library | Script Communications UDF Library | Color Chooser UDF Library | Color Picker Control UDF Library | IPHelper (Vista/7) UDF Library | WinAPI Extended UDF Library | WinAPIVhd UDF Library | Icon Chooser UDF Library | Copy UDF Library | Restart UDF Library | Event Log UDF Library | NotifyBox UDF Library | Pop-up Windows UDF Library | TVExplorer UDF Library | GuiHotKey UDF Library | GuiSysLink UDF Library | Package UDF Library | Skin UDF Library | AITray UDF Library | RDC UDF Library Appropriate path | Button text color | Gaussian random numbers | Header's styles (Vista/7) | ICON resource enumeration | Menu & INI | Tabbed string size | Tab's skin | Pop-up circular menu | Progress Bar without animation (Vista/7) | Registry export | Registry path jumping | Unique hardware ID | Windows alignment More... Link to comment Share on other sites More sharing options...
Valik Posted April 6, 2009 Share Posted April 6, 2009 Sigh, this is why I don't help you people. I end up having to do all the work myself because you can't manage to solve even the most simple of problems. First, Obviously different versions of Windows are using a different class. CabinetWClass is pre-Vista and the other is post-Vista. Or something like that, I don't feel like booting Vista to verify. Second, who gives a fuck, really? Get the right handle to start with and cut out 60% of the code in the process. 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 Biatu and Synapsee 2 Link to comment Share on other sites More sharing options...
KaFu Posted April 6, 2009 Share Posted April 6, 2009 (edited) After a little research I came up with this: When displaying a standard explorer view, the window has a class of 'CabinetWClass'. When displaying a tree view, it uses 'ExploreWClass'. So I assume both classes have to be considered. Edited April 6, 2009 by KaFu  OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Valik Posted April 6, 2009 Share Posted April 6, 2009 (edited) Wow. Your code is 8x longer. That is just... obscene.Edit: Oh, and kudos on actually doing research on the class difference... finally. Edited April 6, 2009 by Valik Link to comment Share on other sites More sharing options...
forumghost Posted April 6, 2009 Author Share Posted April 6, 2009 (edited) still only works sometimes...... it seems as if the explorer takes its loooong time to update itself, anywhere between 2 and 30 seconds (I kept spamming F5 to check), or, well not at all. (code used atm is 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 $var = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden") $var2 = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt") if $var == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "2") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Hidden", "REG_DWORD", "1") endif if $var2 == "1" then RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "0") else RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", "REG_DWORD", "1") endif Call ("_Update_Explorer()") ;quit Exit ) Edited April 6, 2009 by forumghost 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