AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Refresh screen

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Raf
Guest





PostPosted: Sat Jan 19, 2008 5:13 pm    Post subject: Refresh screen Reply with quote

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

Thanks
Back to top
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Sat Jan 19, 2008 10:02 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Guest






PostPosted: Mon Jan 21, 2008 9:13 am    Post subject: Reply with quote

Nice! Very Happy
How about hiding/showing file extensions?
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 6069

PostPosted: Mon Jan 21, 2008 9:21 am    Post subject: Reply with quote

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


Smile
Back to top
View user's profile Send private message
Andreone



Joined: 20 Jul 2007
Posts: 257
Location: Paris, France

PostPosted: Mon Jan 21, 2008 3:47 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Raf
Guest





PostPosted: Wed Jan 23, 2008 3:13 am    Post subject: refreshing Reply with quote

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?
Back to top
Raf
Guest





PostPosted: Wed Jan 23, 2008 3:14 am    Post subject: refreshing Reply with quote

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


Smile


Thanks. I use vb.net only ... is there a way to get the above in that language?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> General Chat All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group