Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate

Refresh screen


  • Please log in to reply
7 replies to this topic
Raf
  • Guests
  • Last active:
  • Joined: --
Using VB, is there a way to do what"Folder Options > View > Do not show hidden files > Refresh" does?

Thanks

Andreone
  • Members
  • 257 posts
  • Last active: Mar 19 2008 05:30 PM
  • Joined: 20 Jul 2007
; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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
return
This 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.

  • Guests
  • Last active:
  • Joined: --
Nice! :D
How about hiding/showing file extensions?

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
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

:)

Andreone
  • Members
  • 257 posts
  • Last active: Mar 19 2008 05:30 PM
  • Joined: 20 Jul 2007
; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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
return
Just 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.

Raf
  • Guests
  • Last active:
  • Joined: --

; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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
return
This 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?

Raf
  • Guests
  • Last active:
  • Joined: --

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?

soggos
  • Members
  • 129 posts
  • Last active: Nov 30 2012 10:35 AM
  • Joined: 27 Mar 2008
:) Very good, it's very speed, u economise my time... great thank's :D
:?: Nobody knows how to > order by date or name or extension... ? :?:
with ahk, all is different!...