jfcby Posted May 27, 2009 Share Posted May 27, 2009 Hi, When my program starts I need to check if file extensions are hidden and if so change them to visible then apply the new settings so that the file extensions are visible when view in explorer.exe. How can the registry be refreshed so that the file extensions are visible when the script below is run? #include <GUIConstantsEx.au3> #include <GuiButton.au3> #include <WinAPI.au3> #include <Constants.au3> #include <WindowsConstants.au3> #include <StaticConstants.au3> ;Set HideFileExt to 1 - Show extensions RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "HideFileExt", _ "REG_DWORD", "1") $GUI = GUICreate("RegChange", 340, 90) $input = GuiCtrlCreateInput("", 5, 25, 330, 16, -1) $btnSelect = GUICtrlCreateButton("Select", 260, 45, 75, 25) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg = $btnSelect ;Select Microsoft Excel Workbook: $sFile = FileOpenDialog("Select file:", "C:\Program Files", "Excel Files (*.*)") If @error Then ContinueLoop GUICtrlSetData($input, $sFile); GUI will be updated at next iteration EndSelect wEnd Determined -- Devoted -- Delivered Make your mind up -- to seriously apply yourself -- accomplishing the desired results. **** A soft answer turneth away wrath: but grievous words stir up anger. Proverbs 15:1 KJB **** Link to comment Share on other sites More sharing options...
Yashied Posted May 29, 2009 Share Posted May 29, 2009 I believe you need to update Explorer, not the registry. This code will do it. Call the function any time after you make the registry change. 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_ExploreroÝ÷ Ûú®¢×ºÚ"µÍÜ ÌÍÚHHHÈPÝ[ ÌÍØJHH 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...
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