Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-29-2001, 09:25 AM
osamaao osamaao is offline
Member
 
Join Date: Jan 2001
Posts: 94
Default How Can I Hide a Folder...

Hi :

How can I hide a folder from the explorer window, or any browser ...(I see a software that can do this thing)

thank in advance, Osama ...
Reply With Quote
  #2  
Old 01-29-2001, 09:49 AM
Lapince Lapince is offline
Senior Member
 
Join Date: Jan 2001
Posts: 163
Default RE: How Can I Hide a Folder...

Yes, you see a software which do that. But this software isn't written in Delphi. To hide a folder, you need to make a VxD file, and that is done in C++, with help of Microsoft DDK. Believe me, there's no way actually to do that in Delphi. You can write the VxD interface, but not the VxD itself.
Reply With Quote
  #3  
Old 01-30-2001, 12:45 AM
ADMack ADMack is offline
Junior Member
 
Join Date: Nov 2000
Posts: 21
Default RE: How Can I Hide a Folder...

Function HideDirectory(Const TheFile : String): Boolean;
Var
Attrib : Integer;
Begin
Result := False;
Try
If Not FileExists(TheFile) Then Exit;
Attributes := faDirectory + faHidden + faSysFile;
FileSetAttr(TheFile,Attributes);
Result := True;
Except
End;
End;

Function UnHideDirectory(Const TheFile : String): Boolean;
Var
Attrib : Integer;
Begin
Result := False;
Try
If Not FileExists(TheFile) Then Exit;
Attributes := faDirectory ;
FileSetAttr(TheFile,Attributes);
Result := True;
Except
End;
End;


The first function hides the directory by setting the attributes to hidden/system.
the second function unhides the directory by setting the attributes to just a directory.


Be warned though: If the windows explorer has the options set to view ALL files, this will NOT WORK!
Reply With Quote
  #4  
Old 01-30-2001, 02:32 AM
Lapince Lapince is offline
Senior Member
 
Join Date: Jan 2001
Posts: 163
Default More precision

I have done such an application. And I have commercial apps which do it. But none of them can really totally hide a folder. Mine can't, too. There's always a way to see if there's an hidden directory somewhere
Reply With Quote
  #5  
Old 04-19-2002, 08:04 AM
GianniM GianniM is offline
Junior Member
 
Join Date: Feb 2001
Posts: 28
Default RE: How Can I Hide a Folder...

I think that some "virus" exists (exe file - not vxd driver) that installs yourself in HKEY_CLASSES_ROOT\file\shell\open\command (or something like this) in registry, then "catch" file calls, then starts program or open file. If you delete virus exe file, you will be unable to open any file. Is that can be used in this case? By default, file calls "catch" rundll32.exe.
Reply With Quote
  #6  
Old 04-19-2002, 09:01 AM
GianniM GianniM is offline
Junior Member
 
Join Date: Feb 2001
Posts: 28
Default RE: How Can I Hide a Folder...

I forgot to explain. For example, start regedit, go to HKEY_CLASSES_ROOT\exefile\shell\open\command key, then change default value from "%1" %* to blahblahblah - you will be unable to start any exe file. After you try, please back default value - "%1" %*


Also, default values for folder are:

HKEY_CLASSES_ROOT\Folder\shell\explore\command

Default value is C:\WINDOWS\Explorer.exe /e,/idlist,%I,%L

HKEY_CLASSES_ROOT\Folder\shell\open\command

Default value is C:\WINDOWS\Explorer.exe /idlist,%I,%L

You can try to wrote application that by command line parameters compares requested folder from explorer with "protected" folders (included all subfolders) list, then if requested folder not in the list, calls explorer with command parameters above. Application shall to replace default values above. That's just my idea, of course. Remember, modifying the registry can cause serious problems that may require you to reinstall your operating system. I cannot guarantee that problems resulting from modifications to the registry can be solved. Use the information provided at your own risk.

If you decide to try this, please use another machine for testing, or install two OS at your machine for restoring registry from backup from one OS to another, if something goes wrong.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 10:09 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.