AutoHotkey Community

It is currently May 25th, 2012, 10:55 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Refresh screen
PostPosted: January 19th, 2008, 5:13 pm 
Using VB, is there a way to do what"Folder Options > View > Do not show hidden files > Refresh" does?

Thanks


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 19th, 2008, 10:02 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Code:
; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2008, 9:13 am 
Nice! :D
How about hiding/showing file extensions?


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2008, 9:21 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Parts copy/pasted from my always-running script:

Code:
#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, 0x111, 28931,,, 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


:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 21st, 2008, 3:47 pm 
Offline

Joined: July 20th, 2007, 10:23 am
Posts: 257
Location: Paris, France
Code:
; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: refreshing
PostPosted: January 23rd, 2008, 3:13 am 
Andreone wrote:
Code:
; ------------------------------------------------------------------------------
;
; @@@@@@@                   @@
;  @    @                    @
;  @                         @
;  @  @   @@@ @@@ @@@@@@     @     @@@@@  @@@ @@   @@@@@  @@@ @@
;  @@@@    @   @   @    @    @    @     @   @@  @ @     @   @@  @
;  @  @     @@@    @    @    @    @     @   @     @@@@@@@   @
;  @        @@@    @    @    @    @     @   @     @         @
;  @    @  @   @   @    @    @    @     @   @     @     @   @
; @@@@@@@ @@@ @@@  @@@@@   @@@@@   @@@@@  @@@@@    @@@@@  @@@@@
;                  @
;                 @@@
;
; ------------------------------------------------------------------------------
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?


Report this post
Top
  
Reply with quote  
 Post subject: refreshing
PostPosted: January 23rd, 2008, 3:14 am 
SKAN wrote:
Parts copy/pasted from my always-running script:

Code:
#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, 0x111, 28931,,, 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?


Report this post
Top
  
Reply with quote  
PostPosted: December 26th, 2008, 12:00 am 
Offline

Joined: March 27th, 2008, 7:46 pm
Posts: 129
Location: France
:) 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!...<img>


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group