Using VB, is there a way to do what"Folder Options > View > Do not show hidden files > Refresh" does?
Thanks

Refresh screen
Started by
Raf
, Jan 19 2008 04:13 PM
7 replies to this topic
#1
-
Posted 19 January 2008 - 04:13 PM

; ------------------------------------------------------------------------------ ; ; @@@@@@@ @@ ; @ @ @ ; @ @ ; @ @ @@@ @@@ @@@@@@ @ @@@@@ @@@ @@ @@@@@ @@@ @@ ; @@@@ @ @ @ @ @ @ @ @@ @ @ @ @@ @ ; @ @ @@@ @ @ @ @ @ @ @@@@@@@ @ ; @ @@@ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ ; @@@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ ; @ ; @@@ ; ; ------------------------------------------------------------------------------ Explorer_Init: GroupAdd, ExplorerGroup, ahk_class ExploreWClass GroupAdd, ExplorerGroup, ahk_class CabinetWClass return ; ------------------------------------------------------------------------------ ; Hotkeys ; ------------------------------------------------------------------------------ #IfWinActive, ahk_group ExplorerGroup ; Alt + 1|2|3|4|5 = set current list view display mode !&::PostMessage, 0x111, 28716,,, A ; Details !é::PostMessage, 0x111, 28715,,, A ; List !"::PostMessage, 0x111, 28714,,, A ; Small Icons !'::PostMessage, 0x111, 28718,,, A ; Tiles !(::PostMessage, 0x111, 28717,,, A ; Thumbnails ; Ctrl + Shift + A = invert selection ^+a::Send !ei ; Ctrl + C = start a command prompt in the current directory !c:: WinGetActiveTitle, title Run %ComSpec%, %title% return ; Ctrl + D = duplicate item ^d::Send ^c^v ; create a new text file !d::Send !fnt ; Alt -> File -> New -> Text document ; create a new directory !f:: WinGetActiveTitle, path loop, 100 { name := A_Index == 1 ? "New Folder" : "New Folder (" . A_Index . ")" IfNotExist, %path%\%name% { FileCreateDir,%path%\%name% Send, {F5} break } } return ; Alt + H = show/hide hidden files !h::Gosub, Explorer_Toggle_HiddenFiles_Display ; Alt + O = opens folder options !o::Run, control folders ; Alt + T = show/hide the tree view !t::SendMessage, 0x111, 41525,,, A ; connect network drive !F11::SendMessage, 0x111, 41525,,, A ; disconnect network drive !F12::SendMessage, 0x111, 41525,,, A #IfWinActive Explorer_Toggle_HiddenFiles_Display: RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden if HiddenFiles_Status = 2 RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1 else RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2 PostMessage, 0x111, 28931,,, A ToolTip, % "Display hidden files: " . (HiddenFiles_Status == "2" ? "ON" : "OFF") Sleep, 1000 ToolTip returnThis is my code for customizing explorers. Alt + H will toggle show/not show hidden files.
Note you must call Explorer_Init to define the group of ahk_classes.
#2
-
Posted 19 January 2008 - 09:02 PM

Parts copy/pasted from my always-running script:
#IfWinActive ahk_class ExploreWClass ^#H::GoSub, Toggle_HiddenFiles_Display #IfWinActive ahk_class CabinetWClass ^#H::GoSub, Toggle_HiddenFiles_Display #IfWinActive #IfWinActive ahk_class ExploreWClass ^#E::GoSub, Toggle_HideFileExtensions #IfWinActive ahk_class CabinetWClass ^#E::GoSub, Toggle_HideFileExtensions #IfWinActive Toggle_HiddenFiles_Display: ID := WinExist("A") RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden if HiddenFiles_Status = 2 RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1 else RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2 PostMessage, [color=red]0x111, 28931[/color],,, ahk_id %ID% Return Toggle_HideFileExtensions: ID := WinExist("A") RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HideExtn_Status, % RootKey, % SubKey, HideFileExt HideExtn_Status := !HideExtn_Status RegWrite, REG_DWORD, % RootKey, % SubKey, HideFileExt, %HideExtn_Status% Sleep 500 PostMessage, 0x111, 28931,,, ahk_id %ID% Return

#4
-
Posted 21 January 2008 - 08:21 AM

; ------------------------------------------------------------------------------ ; ; @@@@@@@ @@ ; @ @ @ ; @ @ ; @ @ @@@ @@@ @@@@@@ @ @@@@@ @@@ @@ @@@@@ @@@ @@ ; @@@@ @ @ @ @ @ @ @ @@ @ @ @ @@ @ ; @ @ @@@ @ @ @ @ @ @ @@@@@@@ @ ; @ @@@ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ ; @@@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ ; @ ; @@@ ; ; ------------------------------------------------------------------------------ Explorer_Init: GroupAdd, ExplorerGroup, ahk_class ExploreWClass GroupAdd, ExplorerGroup, ahk_class CabinetWClass return ; ------------------------------------------------------------------------------ ; Hotkeys ; ------------------------------------------------------------------------------ #IfWinActive, ahk_group ExplorerGroup ; Alt + 1|2|3|4|5 = set current list view display mode !&::PostMessage, 0x111, 28716,,, A ; Details !é::PostMessage, 0x111, 28715,,, A ; List !"::PostMessage, 0x111, 28714,,, A ; Small Icons !'::PostMessage, 0x111, 28718,,, A ; Tiles !(::PostMessage, 0x111, 28717,,, A ; Thumbnails ; Ctrl + Shift + A = invert selection ^+a::Send !ei ; Ctrl + C = start a command prompt in the current directory !c:: WinGetActiveTitle, title Run %ComSpec%, %title% return ; Ctrl + D = duplicate item ^d::Send ^c^v ; create a new text file !d::Send !fnt ; Alt -> File -> New -> Text document ; create a new directory !f:: WinGetActiveTitle, path loop, 100 { name := A_Index == 1 ? "New Folder" : "New Folder (" . A_Index . ")" IfNotExist, %path%\%name% { FileCreateDir,%path%\%name% Send, {F5} break } } return ; Alt + E = show/hide file extensions !e::Gosub, Explorer_Toggle_HideFileExtensions ; Alt + H = show/hide hidden files !h::Gosub, Explorer_Toggle_ShowHiddenFiles ; Alt + O = opens folder options !o::PostMessage, 0x111, 28771,,, A ; Alt + U = customize folder !u::PostMessage, 0x111, 28722,,, A ; Alt + T = show/hide the tree view !t::SendMessage, 0x111, 41525,,, A ; ALT + N = connect network drive !n::PostMessage, 0x111, 41089,,, A ; ALT + SHIFT + N = disconnect network drive +!n::PostMessage, 0x111, 41090,,, A #IfWinActive Explorer_Toggle_HideFileExtensions: RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenExt_Status, % RootKey, % SubKey, HideFileExt HiddenExt_Status := !HiddenExt_Status RegWrite, REG_DWORD, % RootKey, % SubKey, HideFileExt, %HiddenExt_Status% Sleep 500 PostMessage, 0x111, 28931,,, A Return Explorer_Toggle_ShowHiddenFiles: RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden if HiddenFiles_Status = 2 RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1 else RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2 PostMessage, 0x111, 28931,,, A ToolTip, % "Display hidden files: " . (HiddenFiles_Status == "2" ? "ON" : "OFF") Sleep, 500 ToolTip returnJust an update with SKAN's hiding/showing file extensions trick.
Also added: Alt+N and Alt+Shift+N to show the connect network drive na disconnect network drive dialogs.
#5
-
Posted 21 January 2008 - 02:47 PM

; ------------------------------------------------------------------------------ ; ; @@@@@@@ @@ ; @ @ @ ; @ @ ; @ @ @@@ @@@ @@@@@@ @ @@@@@ @@@ @@ @@@@@ @@@ @@ ; @@@@ @ @ @ @ @ @ @ @@ @ @ @ @@ @ ; @ @ @@@ @ @ @ @ @ @ @@@@@@@ @ ; @ @@@ @ @ @ @ @ @ @ @ ; @ @ @ @ @ @ @ @ @ @ @ @ @ ; @@@@@@@ @@@ @@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ @@@@@ ; @ ; @@@ ; ; ------------------------------------------------------------------------------ Explorer_Init: GroupAdd, ExplorerGroup, ahk_class ExploreWClass GroupAdd, ExplorerGroup, ahk_class CabinetWClass return ; ------------------------------------------------------------------------------ ; Hotkeys ; ------------------------------------------------------------------------------ #IfWinActive, ahk_group ExplorerGroup ; Alt + 1|2|3|4|5 = set current list view display mode !&::PostMessage, 0x111, 28716,,, A ; Details !é::PostMessage, 0x111, 28715,,, A ; List !"::PostMessage, 0x111, 28714,,, A ; Small Icons !'::PostMessage, 0x111, 28718,,, A ; Tiles !(::PostMessage, 0x111, 28717,,, A ; Thumbnails ; Ctrl + Shift + A = invert selection ^+a::Send !ei ; Ctrl + C = start a command prompt in the current directory !c:: WinGetActiveTitle, title Run %ComSpec%, %title% return ; Ctrl + D = duplicate item ^d::Send ^c^v ; create a new text file !d::Send !fnt ; Alt -> File -> New -> Text document ; create a new directory !f:: WinGetActiveTitle, path loop, 100 { name := A_Index == 1 ? "New Folder" : "New Folder (" . A_Index . ")" IfNotExist, %path%\%name% { FileCreateDir,%path%\%name% Send, {F5} break } } return ; Alt + H = show/hide hidden files !h::Gosub, Explorer_Toggle_HiddenFiles_Display ; Alt + O = opens folder options !o::Run, control folders ; Alt + T = show/hide the tree view !t::SendMessage, 0x111, 41525,,, A ; connect network drive !F11::SendMessage, 0x111, 41525,,, A ; disconnect network drive !F12::SendMessage, 0x111, 41525,,, A #IfWinActive Explorer_Toggle_HiddenFiles_Display: RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden if HiddenFiles_Status = 2 RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1 else RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2 PostMessage, 0x111, 28931,,, A ToolTip, % "Display hidden files: " . (HiddenFiles_Status == "2" ? "ON" : "OFF") Sleep, 1000 ToolTip returnThis is my code for customizing explorers. Alt + H will toggle show/not show hidden files.
Note you must call Explorer_Init to define the group of ahk_classes.
Thanks. I use vb.net only ... is there a way to get the above in that language?
#6
-
Posted 23 January 2008 - 02:13 AM

Parts copy/pasted from my always-running script:
#IfWinActive ahk_class ExploreWClass ^#H::GoSub, Toggle_HiddenFiles_Display #IfWinActive ahk_class CabinetWClass ^#H::GoSub, Toggle_HiddenFiles_Display #IfWinActive #IfWinActive ahk_class ExploreWClass ^#E::GoSub, Toggle_HideFileExtensions #IfWinActive ahk_class CabinetWClass ^#E::GoSub, Toggle_HideFileExtensions #IfWinActive Toggle_HiddenFiles_Display: ID := WinExist("A") RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HiddenFiles_Status, % RootKey, % SubKey, Hidden if HiddenFiles_Status = 2 RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 1 else RegWrite, REG_DWORD, % RootKey, % SubKey, Hidden, 2 PostMessage, [color=red]0x111, 28931[/color],,, ahk_id %ID% Return Toggle_HideFileExtensions: ID := WinExist("A") RootKey = HKEY_CURRENT_USER SubKey = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced RegRead, HideExtn_Status, % RootKey, % SubKey, HideFileExt HideExtn_Status := !HideExtn_Status RegWrite, REG_DWORD, % RootKey, % SubKey, HideFileExt, %HideExtn_Status% Sleep 500 PostMessage, 0x111, 28931,,, ahk_id %ID% Return
Thanks. I use vb.net only ... is there a way to get the above in that language?
#7
-
Posted 23 January 2008 - 02:14 AM



:?: Nobody knows how to > order by date or name or extension... ? :?:
#8
-
Posted 25 December 2008 - 11:00 PM

with ahk, all is different!...