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 

Show/Hide Hidden files and folders
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
jps



Joined: 02 Sep 2006
Posts: 253
Location: Scotland

PostPosted: Sat Oct 21, 2006 2:02 am    Post subject: Show/Hide Hidden files and folders Reply with quote

Can anyone tell me a way to make a hotkey toggle whether hidden files and folders are shown or not?

I've searched but havent been able to find anything.
Back to top
View user's profile Send private message
AiKscroll



Joined: 06 Jun 2005
Posts: 179
Location: Northern Virginia

PostPosted: Sat Oct 21, 2006 4:24 am    Post subject: Reply with quote

First you have to resolve how you want this done. Is it acceptable to have the script launch Control panel, then Folder options, then check the correct box, etc? Or is it not, say you want to do this in the middle of a game.

If you want it done without the messing with the many steps, you need to figure out what windows is doing when you show/hide folders whether it be messing with the registry, writing to an ini, or whatever. Knowing that will help you determine how to go about solving this problem.

If anyone knows what the Folder Options dialog does when you check/uncheck Show hidden files please mention it, cause I don't know.
_________________
_AiK
Back to top
View user's profile Send private message AIM Address
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 5:05 am    Post subject: Re: Show/Hide Hidden files and folders Reply with quote

jps wrote:
Can anyone tell me a way to make a hotkey toggle whether hidden files and folders are shown or not?


AiKscroll wrote:
If anyone knows what the Folder Options dialog does when you check/uncheck Show hidden files please mention it, cause I don't know.


The following code toggles the hidden files view, in Windows Explorer:

Code:
^F2::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


See: How to Toggle Hidden files view in Windows Explorer?

Regards, Smile
_________________
Back to top
View user's profile Send private message
aCkRiTe



Joined: 21 Jul 2006
Posts: 517

PostPosted: Sat Oct 21, 2006 5:17 am    Post subject: Reply with quote

I see Goyyah beat me to it. Laughing This is what I came up with though

Code:

#SingleInstance Force
#Persistent
#NoEnv
SetBatchLines, -1
Value = 1
#H::
If Value = 1
   Value = 2
Else
   Value = 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\, Hidden, %Value%


More info here...
http://www.winguides.com/registry/display.php/1007/
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 5:22 am    Post subject: Reply with quote

aCkRiTe wrote:
This is what I came up with though


Nice Very Happy.. I had borrowed the code except for PostMessage, 0x111, 41504,,, which simulates the F5 (refresh).

Regards, Smile
_________________
Back to top
View user's profile Send private message
aCkRiTe



Joined: 21 Jul 2006
Posts: 517

PostPosted: Sat Oct 21, 2006 5:25 am    Post subject: Reply with quote

Ahh... I forgot the Refresh{F5} part... Thanks Goyyah! I always learn something in here!
Back to top
View user's profile Send private message
Hansol



Joined: 27 Dec 2005
Posts: 18

PostPosted: Sat Oct 21, 2006 1:51 pm    Post subject: Reply with quote

Quote:
However, as said before, the problem seems to be in refreshing the registry but, if after running the script i run regedit and update using F5 manually, then turn to explorer and press F5 the changes are not shown.

On the other and, if, after running the script, i manually go to tools -> folder options.. -> second tab (see or view), i can see that the option has changed and if i close the window (not even need to press accept) then the trick is done.
http://www.autohotkey.com/forum/viewtopic.php?t=1204
Is there any way to solve that problem? The changes is done but take no effect?
Back to top
View user's profile Send private message MSN Messenger
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 8:52 pm    Post subject: Reply with quote

Hansol wrote:
Is there any way to solve that problem? The changes is done but take no effect?


I see the point.. I had tested that code only in Windows 98 SE.. It does not seem to work in Windows 2000 for me now! Sad

I will try and find a way & post again.. Thanks! Smile
_________________
Back to top
View user's profile Send private message
aCkRiTe



Joined: 21 Jul 2006
Posts: 517

PostPosted: Sat Oct 21, 2006 10:15 pm    Post subject: Reply with quote

I havent tested, but would this work...

Code:
Run, %A_WinDir%\System32\RUNDLL32.EXE user32.dll`,UpdatePerUserSystemParameters
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 10:17 pm    Post subject: Reply with quote

aCkRiTe wrote:
but would this work...


It does not Sad ..
_________________
Back to top
View user's profile Send private message
jps



Joined: 02 Sep 2006
Posts: 253
Location: Scotland

PostPosted: Sat Oct 21, 2006 10:30 pm    Post subject: Reply with quote

Thanks for the replies guys Very Happy

I find pressing F5 works only some of the time but pressing the Appskey and then e works every time.

I can live with the right-click menu showing for a brief second so I tried incorporating that into the script but with no avail.

Could you edit one of the scripts to refresh that way for me?

Sorry for just straight up asking you guys to do stuff for me but i'm really struggling to get the hang of scripting.I'm sure i'll get there in the end but it will take a while.The only programing experience i have was using basic at school 10 years ago lol
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 10:41 pm    Post subject: Reply with quote

jps wrote:
Could you edit one of the scripts to refresh that way for me?


Replace the PostMessage line with

Code:
Send {AppsKey}e


Regards, Smile

PS: Keep a watch on this topic.. I will post again if I come out with something more elegant!
_________________
Back to top
View user's profile Send private message
Conquer



Joined: 27 Jun 2006
Posts: 385
Location: Canada

PostPosted: Sat Oct 21, 2006 10:41 pm    Post subject: Reply with quote

AppsKey & E Code:
Code:
Send {AppsKey}E


EDIT:
That was a fast reply, goyah!! Beat mine... Sad
_________________


Last edited by Conquer on Sat Oct 21, 2006 10:51 pm; edited 1 time in total
Back to top
View user's profile Send private message
jps



Joined: 02 Sep 2006
Posts: 253
Location: Scotland

PostPosted: Sat Oct 21, 2006 10:44 pm    Post subject: Reply with quote

Thanks for such a quick reply. It works a charm. Very Happy

I always get mixed up with where to put my curly braces
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6223

PostPosted: Sat Oct 21, 2006 11:33 pm    Post subject: Reply with quote

Conquer wrote:
That was a fast reply, goyah!! Beat mine... Sad


That happens many times for me too Very Happy
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
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