AutoHotkey Community

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: refreshing
PostPosted: January 23rd, 2008, 2:52 am 
Calabaza wrote:
Well, just right clicking and then refreshing is ok for me, much more faster than doing it by hand as before...

Thanks for the tip...


You are absolutely right BUT the whole point is to protect some files programatically. In vb.net, file'attribute can be set to hidden but I would like to make the hidden file "invisible" on the screen.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2008, 3:11 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
Raf wrote:
EdBott's approach toggles the "show" and "do not show" hidden files BUT the hidden file remains visible on the screen. Ed is aware of the problem and had not had time to search for the solution.

Here's a script I wrote which has that feature:
http://www.autohotkey.com/forum/viewtopic.php?t=24879
It's not terribly well commended though. I learned how to do it in this thread:
http://www.autohotkey.com/forum/viewtopic.php?t=8795
so you may be better off referring to that directly.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2008, 3:30 am 
ManaUser wrote:
Raf wrote:
EdBott's approach toggles the "show" and "do not show" hidden files BUT the hidden file remains visible on the screen. Ed is aware of the problem and had not had time to search for the solution.

Here's a script I wrote which has that feature:
http://www.autohotkey.com/forum/viewtopic.php?t=24879
It's not terribly well commended though. I learned how to do it in this thread:
http://www.autohotkey.com/forum/viewtopic.php?t=8795
so you may be better off referring to that directly.



Thanks. If you have or know how to do that in vb.net, please direct me to that source.

Regards


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2008, 3:40 am 
Offline

Joined: May 24th, 2007, 3:45 am
Posts: 1121
I assumed you could post the same message to Explorer using vb. I couldn't tell you exactly how to do that though. Good luck.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 23rd, 2008, 9:37 pm 
Offline

Joined: March 12th, 2007, 5:25 am
Posts: 14
Does anybody happen to know of a way to have this functionality in xplorer²?

Edit.

_________________
-Thracx

"Man wants to know, and when he ceases to do so, he is no longer a man."
-Fridtjof Nansen


Last edited by Thracx on February 17th, 2010, 9:23 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject: Modification
PostPosted: March 13th, 2009, 1:08 am 
Hi All,
I know I'm late in posting to this thread, but I just got AutoHotKey today. I was looking for a way to toggle hidden files and Google led me here. I tried using thinkstorm's script, but I couldn't get it to work for me, so I made some modifications to it. The main difference is I used Window Spy to get mouse coordinates for selecting hide or show hidden files. Then I used {Tab} and {Enter} to select the Apply and OK buttons. This eliminates the need to run the script twice or refresh the window. Just make sure explorer is the active window when you hit the hot keys.
Code:
showHidden=0

#H::
   WinGetActiveTitle, WinTitle
   WinGetClass, WinClass, %WinTitle%
   If WinClass <> CabinetWClass
      If WinClass <> ExploreWClass
         Return
   Send, !T
   Sleep, 1
   Send, o
   WinWaitActive, Folder Options,,5
   if ErrorLevel = 1
      Return
   Send, ^{Tab} 
   Sleep, 20
   If showHidden  = 0
   {
      showHidden = 1
      Click, 78,355
      Sleep, 200
      Send, {Tab 4}{Enter}
      Sleep, 500
      Send, {Tab 4}{Enter}
   }
   Else
   {
      showHidden = 0
      Click, 78,337
      Sleep, 200
      Send, {Tab 4}{Enter}
      Sleep, 500
      Send, {Tab 4}{Enter}
   }
Return


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 24th, 2009, 4:36 pm 
Code:
#noenv
setbatchlines -1
setmousedelay -1
setwindelay -1
coordmode mouse, screen

ID := WinExist("A")
WinGetClass,Class, ahk_id %ID%
WClasses := "CabinetWClass ExploreWClass"
IfNotInString, WClasses, %Class%
   Exitapp

Mousegetpos mx,my
WinGetPos wx,wy,ww,wh, ahk_id %id%

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
     
mousemove ww+wx-10, wy+110
Send {rbutton}{e}
mousemove mx,my


Report this post
Top
  
Reply with quote  
 Post subject: Re: How to refresh
PostPosted: March 25th, 2010, 7:26 pm 
Offline

Joined: March 25th, 2010, 7:23 pm
Posts: 1
Location: The Internet
Sorry for bumping, just wanted to thanks to everyone for their posts, I eventually figured this out with their help.

In Windows 7, sending a plain old F5 will refresh the Explorer window, dunno about previous versions. This is what I ended up with:

Code:
#h::

RegRead, ValorHidden, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden

if ValorHidden = 2
   RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
Else
   RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2

send {F5}

Return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 12:15 pm 
just add the extra code for refreshing, like this
[/code]#h::
RegRead, ValorHidden, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
if ValorHidden = 2
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
else
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
Send {AppsKey}e return
Code:


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 10:43 pm 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
I use this, it toggles "superhidden" files and uses postmessage to send refresh to the current page...
(not sure where I found this before on the forum)
Code:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;          --- TOGGLE "SUPERHIDDEN" FILES ---
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
F11::GoSub,CheckActiveWindow

CheckActiveWindow:
  ID := WinExist("A")
  WinGetClass,Class, ahk_id %ID%
  WClasses := "CabinetWClass ExploreWClass"
  IfInString, WClasses, %Class%
    GoSub, Toggle_HiddenFiles_Display
Return

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, 41504,,, ahk_id %ID%
Return

_________________
Disclaimer: I'm not an expert by any means; I just try to help out where I can.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 10:50 pm 
Offline

Joined: March 7th, 2011, 2:59 am
Posts: 151
Image What are "superhidden" files? Image

This is Bunny. Help Bunny gain World Domination. :lol:
Image Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 13th, 2011, 10:52 pm 
Offline

Joined: December 26th, 2010, 7:40 pm
Posts: 4172
Location: Awesometown, USA
I think he means 'System hidden' :arrow: Attributes S or SH

_________________
Autofire, AutoClick, Toggle, SpamWindow Control Tools
Recommended: AutoHotkey_L


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 14th, 2011, 7:09 am 
Offline

Joined: September 15th, 2009, 1:14 am
Posts: 562
nimda wrote:
I think he means 'System hidden' :arrow: Attributes S or SH

Yeah, that's what I meant. :D

_________________
Disclaimer: I'm not an expert by any means; I just try to help out where I can.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2011, 8:55 am 
Offline

Joined: April 21st, 2007, 9:16 pm
Posts: 178
My version of ToggleHiddenFiles.

It uses the concept of windows group to refresh all currently opened Explorer windows by sending {F5} to the listview.

It supports command line arguments, or, without argument, it stays resident in the tray.

It uses OnMessage(AHK_NOTIFYICON) to refresh the tray menu just before displaying it, so that changes made using the Windows Folder Options control panel are taken into account.

Developed and tested under Win7 X64. It should work also under XP and Vista.

Code:
; HiddenFiles.ahk by r0lZ, June 5, 2011
#NoEnv
#SingleInstance ignore
#UseHook off
#Persistent
Menu, tray, noicon

ControlGet, hwWindow, HWND,, SysListView321, ahk_class Progman
if hwWindow {
   ; Win XP
   desktopclassname := "Progman"
   explorerlistview := "SysListView321"
} else {
   ; Win 7
   desktopclassname := "WorkerW"
   explorerlistview := "DirectUIHWND3"
}
GroupAdd, ExplorerWindowsGroup, ahk_class CabinetWClass

firstarg =
if 0 >= 1
{
   firstarg = %1%
   if (firstarg == "/h")
      ShowHiddenFiles(0)
   else if (firstarg == "/s")
      ShowHiddenFiles(1)
   else if (firstarg == "/sh")
      ShowHiddenFiles(2)
   else if (firstarg == "/swap")
      Gosub, ToggleHiddenFiles
   else
      GoSub, Usage
   ExitApp
}

menu, tray, NoStandard
menu, tray, Add, Help, Usage
menu, tray, Add, Exit, CleanExit
menu, tray, Add
menu, tray, Add, Hide Hidden Files, HideHiddenFiles
menu, tray, Add, Show Hidden Files, ShowHiddenFiles
menu, tray, Add, Show Hidden and System Files, ShowSystemFiles
menu, tray, Add
menu, tray, Add, Swap Show/Hide Hidden Files, ToggleHiddenFiles
menu, tray, Default, Swap Show/Hide Hidden Files
menu, tray, Icon

; monitors buttons clicks on tray icon
OnMessage(0x404, "OnWM_BUTTONUPMessage")   ; 0x404 = AHK_NOTIFYICON

Return

ToggleHiddenFiles:
   RegRead, ValorHidden,     HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
   if (ValorHidden == 2)
      ShowHiddenFiles(1)
   else
      ShowHiddenFiles(0)
Return
HideHiddenFiles:
   ShowHiddenFiles(0)
Return
ShowHiddenFiles:
   ShowHiddenFiles(1)
Return
ShowSystemFiles:
   ShowHiddenFiles(2)
Return
ShowHiddenFiles(mode) {
   if (mode == 0) {
      RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 2
   } else if (mode == 1) {
      RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
      RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 0
   } else {
      RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 1
      RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 1
   }
   sleep, 10
   RefreshExplorerWindows()
   ; refresh all Explorer windows
   ControlSend, DirectUIHWND3, {F5}, ahk_group ExplorerWindowsGroup
   return
}

RefreshExplorerWindows()
{
   global desktopclassname, explorerlistview

   ; refresh Desktop
   ControlSend, ahk_parent, {F5}, ahk_class %desktopclassname%

   ; refresh all Explorer windows
   ControlSend, %explorerlistview%, {F5}, ahk_group ExplorerWindowsGroup

   return
}

OnWM_BUTTONUPMessage(wParam, lParam)
{
   Critical
   ; Refresh tray menu if Right button pressed
   if (lParam == 0x204) {
      RegRead, ValorHidden,     HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden
      RegRead, ShowSuperHidden, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden

      menu, tray, UnCheck, Hide Hidden Files
      menu, tray, UnCheck, Show Hidden Files
      menu, tray, UnCheck, Show Hidden and System Files
      if (ValorHidden == 2) {
         menu, tray, Check, Hide Hidden Files
      } else {
         if (ShowSuperHidden) {
            menu, tray, Check, Show Hidden and System Files
         } else {
            menu, tray, Check, Show Hidden Files
         }
      }
   }
   Critical, off
}

Usage:
   MsgBox, 64, HiddenFiles by r0lZ - Freeware, HiddenFiles is an easy way to show or hide the hidden files in all Explorer windows and on the Desktop.`n`nCommand line usage:`nHiddenFiles /h  -> Hide hidden files`nHiddenFiles /s  -> Show hidden files`nHiddenFiles /sh  -> Show hidden and system files`nHiddenFiles /swap  -> Swap Show/Hide hidden files`nHiddenFiles /?  -> Show this help dialogue`nHiddenFiles  -> Without argument, stays resident in the tray
Return

CleanExit:
ExitApp

_________________
r0lZ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 22nd, 2011, 7:09 pm 
Online
User avatar

Joined: June 22nd, 2011, 4:02 pm
Posts: 165
r0lZ wrote:
My version of ToggleHiddenFiles.

It uses the concept of windows group to refresh all currently opened Explorer windows by sending {F5} to the listview.


Interesting solution, but it seems overly complicated for the desired effect. This works on Win7 and with slight modification on Win XP:
Code:
;
; AutoHotkey Version: 1.0.48.05
; Language:           English
; Platform:           Win9x/NT
; Author:             rbrtryn
;
; This script will show or hide hidden files or extensions
;
; The folder options dialog seems to change slightly with each version of the
; Windows OS, so the variables HidePos and ExtensionPos will have to be changed
; to match your setup.
;
; ************************************************
; *  Hotkeys Defined:                            *
; *  ^#h     Show or hide the hidden files       *
; *  ^#e     Show or hide file extensions        *
; ************************************************

#NoEnv
SendMode Input

SleepTime = 200 ; Time to wait before clicking OK
HidePos = 9     ; XP : 9, Win7 : 7
ExtensionPos=11 ; XP : 11, Win7 : 10

; ********** End of AutoExecute Section **********

^#h::
   ; ***** Get the current status from the Registry
   ; ***** 1 = Files are shown
   ; ***** 2 = Files are hidden
   RootKey = HKEY_CURRENT_USER
   SubKey  = Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
   RegRead, HiddenFiles_Status, % RootKey,% SubKey, Hidden

   Gosub FolderOptionsDialog

   Send, {Down %HidePos%}    ; Select the 'Hide' Button

   If HiddenFiles_Status = 2 ; If files are Hidden ...
      Send, {Down}           ;   Select the 'Show' Button

   Send, {Space}             ; Click the Button

   Sleep %SleepTime%
   ControlClick, OK
Return

^#e::
   Gosub FolderOptionsDialog
   Send {Down %ExtensionPos%}{Space}  ; Check or UnCheck the box
   Sleep %SleepTime%
   ControlClick, OK
Return

FolderOptionsDialog:
   ; ***** Bring up the folder options dialog
   Run, c:\windows\system32\Rundll32.exe c:\windows\system32\shell32.dll`,Options_RunDLL 0,,
   WinWait, Folder Options
   WinActivate

   ControlFocus, SysTabControl321    ; Tabs
   Send, {Right}                     ; View Tab
   Sleep 100                         ; Wait for window repaint
   ControlFocus, SysTreeView321      ; Options tree
Return
 


Last edited by rbrtryn on June 24th, 2011, 5:21 pm, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


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