orbs

tray menu to show/hide files extensions, hidden & system files, and selection checkboxes

3 posts in this topic

#1 ·  Posted (edited)

"Show For Files" is a simple app resident in the system tray, allows to easily toggle show/hide of files extensions, hidden files, system files (a.k.a "super hidden files"), and files selection checkboxes:

 

ShowForFiles_-_tray_menu.thumb.png.6b057

 

Notes:

checkmarks are updated at the tray menu items as they change in the registry, even when changed manually or by other means.

showing system files implies showing hidden files (but not vice-versa). this is reflected in the checkmarks.

this app does NOT apply to 3rd-party files managers (unless they respect Windows settings).

all Windows Explorer windows are refreshed when this app changes any settings.

click the tray menu header to jump to this page.

 

additional features may be added as i find useful.

 

Script:

#region AutoIt3Wrapper directives section
#AutoIt3Wrapper_Au3Check_Parameters=-q -d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7
#AutoIt3Wrapper_Icon=ShowForFiles.ico
#AutoIt3Wrapper_UseUpx=N
#AutoIt3Wrapper_Res_Comment=https://www.autoitscript.com/forum/topic/174503-tray-menu-to-showhide-files-extensions-hidden-system-files-and-selection-checkboxes/
#AutoIt3Wrapper_Res_Description=Modifies the folder view to show/hide various file options.
#AutoIt3Wrapper_Res_Fileversion=0.3.0.0
#AutoIt3Wrapper_Res_ProductVersion=0.3
#AutoIt3Wrapper_Res_LegalCopyright=n/a
://////=__=://///= Files
#AutoIt3Wrapper_Run_Au3Stripper=y
#Au3Stripper_Parameters=/SO /RM
#endregion AutoIt3Wrapper directives section

#cs - ref:
    http://www.askvg.com/create-simple-script-to-show-hide-file-extensions-in-windows-xp-vista-and-7/
    http://www.askvg.com/create-simple-script-to-show-hide-hidden-files-and-folders-in-windows-xp-vista-and-7/
    http://www.askvg.com/create-simple-script-to-show-hide-checkbox-to-select-items-in-windows-xp-vista-and-7/
#ce

#NoTrayIcon
#include <Constants.au3>

Opt('TrayOnEventMode', 1)
Opt('TrayMenuMode', 1) ; Default tray menu items (Script Paused/Exit) will not be shown. but AUTO-TOGGLE CHECKMARK is still ON, which is ok.
Global $tHeader = TrayCreateItem('Show For Files:')
TrayItemSetOnEvent(-1, 'Header')
TrayItemSetState(-1, $TRAY_DEFAULT)
Global $tExt = TrayCreateItem('  Extensions')
TrayItemSetOnEvent(-1, 'ShowExt')
Global $tHid = TrayCreateItem('  Hidden Files')
TrayItemSetOnEvent(-1, 'ShowHid')
Global $tSys = TrayCreateItem('  System Files')
TrayItemSetOnEvent(-1, 'ShowSys')
Global $tBox = TrayCreateItem('  Checkboxes')
TrayItemSetOnEvent(-1, 'ShowBox')
TrayCreateItem('')
TrayCreateItem('Exit')
TrayItemSetOnEvent(-1, '_Exit')
TraySetState()
TraySetToolTip(Chr(0))

While True
    UpdateCheckmarks()
    Sleep(100)
WEnd

Func UpdateCheckmarks()
    If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt') = 1 Then
        TrayItemSetState($tExt, $TRAY_UNCHECKED)
    Else
        TrayItemSetState($tExt, $TRAY_CHECKED)
    EndIf
    If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden') = 1 Then
        TrayItemSetState($tHid, $TRAY_CHECKED)
    Else
        TrayItemSetState($tHid, $TRAY_UNCHECKED)
    EndIf
    If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden') = 1 Then
        TrayItemSetState($tSys, $TRAY_CHECKED)
    Else
        TrayItemSetState($tSys, $TRAY_UNCHECKED)
    EndIf
    If RegRead('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect') = 1 Then
        TrayItemSetState($tBox, $TRAY_CHECKED)
    Else
        TrayItemSetState($tBox, $TRAY_UNCHECKED)
    EndIf
EndFunc   ;==>UpdateCheckmarks

Func _Update_Explorer() ; ref: https://www.autoitscript.com/forum/topic/95139-update-refresh-windows-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

Func Header()
    ShellExecute('https://www.autoitscript.com/forum/topic/174503-tray-menu-to-showhide-files-extensions-hidden-system-files-and-selection-checkboxes/')
    TrayItemSetState($tHeader, $TRAY_UNCHECKED)
EndFunc   ;==>Header

Func ShowExt()
    If BitAND(TrayItemGetState($tExt), $TRAY_UNCHECKED) Then
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt', 'REG_DWORD', 1)
    Else
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'HideFileExt', 'REG_DWORD', 0)
    EndIf
    _Update_Explorer()
EndFunc   ;==>ShowExt

Func ShowHid()
    If BitAND(TrayItemGetState($tHid), $TRAY_UNCHECKED) Then
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 0)
    Else
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 1)
    EndIf
    _Update_Explorer()
EndFunc   ;==>ShowHid

Func ShowSys()
    If BitAND(TrayItemGetState($tSys), $TRAY_UNCHECKED) Then
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden', 'REG_DWORD', 0)
    Else
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'ShowSuperHidden', 'REG_DWORD', 1)
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'Hidden', 'REG_DWORD', 1) ; show system files implies show hidden files
    EndIf
    _Update_Explorer()
EndFunc   ;==>ShowSys

Func ShowBox()
    If BitAND(TrayItemGetState($tBox), $TRAY_UNCHECKED) Then
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect', 'REG_DWORD', 0)
    Else
        RegWrite('HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced', 'AutoCheckSelect', 'REG_DWORD', 1)
    EndIf
    _Update_Explorer()
EndFunc   ;==>ShowBox

Func _Exit()
    Exit
EndFunc   ;==>_Exit

Download:

save the script as "ShowForFiles.au3" and download the attached icon to compile (until i figure out how to upload the 817 KB compiled exe to the forum).

ShowForFiles.ico

EDIT: minor fix - clicking the header no longer triggers a checkmark on the header.

Edited by orbs
3 people like this

Share this post


Link to post
Share on other sites



I guess it's useful for pre-Windows 8


_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 04/09/2015

Share this post


Link to post
Share on other sites

"Windows 8"? what's that?

yes, i see Windows 10 has some of it quite elegantly put in the explorer ribbon; but i need it on Windows 7, and i need especially to show/hide System files, which Microsoft is still too keen to keep hidden. who would have thought...

 

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