Solved

How to get the list of file names from recycled bin directory?

Posted on 1998-10-26
7
159 Views
Last Modified: 2010-04-06
Hi,

Does anyone knows how to get the list of file names from system recycled bin directory? If I use TFileList box, it's only giving the links to the deleted files but I would like to have the original file names.

Thanks in advance.
0
Comment
Question by:NYang
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 20

Expert Comment

by:Madshi
ID: 1344442
You could use the IShellLink COM object to examine the links.

Regards, Madshi.
0
 

Author Comment

by:NYang
ID: 1344443
Madshi,  

Any possible for more detail about how to use this IShellLink COM?

Thanks.

NYang
0
 
LVL 1

Expert Comment

by:jecksom
ID: 1344444
Hi NyANG !

Madshi right , but you could also make structure (type) from 'Info.' hidden file in
recycled directory , first parameters (bytes) not really nessary for you , just get names
and then resolve them as Madshi said !

Jecksom


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:NYang
ID: 1344445
Madshi, Jecksom,

I am sorry that I don't have any idea about Com Objects. Would you mind giving a small example?

Many many thanks.

Nyang
0
 
LVL 20

Accepted Solution

by:
Madshi earned 100 total points
ID: 1344446
Nyang,

here comes my "LoadShellLink" function. If you just want to know the name of the original file, call
"if LoadShellLink(linkFileName,@linkedObjStr,nil,nil,nil) then ..."

type TPString           = ^string;
var  NeedToUninitialize : boolean = false;

function LoadShellLink(shellLinkFile: string; linkedObj,params,workingDir,hotKey: TPString) : boolean;
var sl  : IShellLink;
    w1  : word;
    wfd : TWin32FindDataA;
begin
  NeedToUninitialize:=NeedToUninitialize or succeeded(CoInitialize(nil));
  sl:=CreateComObject(CLSID_ShellLink) as IShellLink;
  result:=(sl as IPersistFile).Load(PWideChar(wideString(ShellLinkFile)),0)=S_OK;
  if not result then exit;
  if linkedObj<>nil then begin
    SetLength(linkedObj^,MAX_PATH+1);
    if sl.GetPath(PChar(linkedObj^),MAX_PATH,wfd,0)=NOERROR then linkedObj^:=string(PChar(linkedObj^))
      else                                                         linkedObj^:='';
  end;
  if hotKey<>nil then begin
    sl.GetHotKey(w1);
    if w1 and (HOTKEYF_ALT     shl 8)<>0 then w1:=(w1 and (not (HOTKEYF_ALT     shl 8))) or scAlt;
    if w1 and (HOTKEYF_CONTROL shl 8)<>0 then w1:=(w1 and (not (HOTKEYF_CONTROL shl 8))) or scCtrl;
    if w1 and (HOTKEYF_SHIFT   shl 8)<>0 then w1:=(w1 and (not (HOTKEYF_SHIFT   shl 8))) or scShift;
    hotKey^:=ShortCutToText(w1);
  end;
  if params<>nil then begin
    SetLength(params^,MAX_PATH+1);
    if sl.GetArguments(PChar(params^),MAX_PATH)=NOERROR then params^:=string(PChar(params^))
    else                                                     params^:='';
  end;
  if workingDir<>nil then begin
    SetLength(workingDir^,MAX_PATH+1);
    if sl.GetWorkingDirectory(PChar(workingDir^),MAX_PATH)=NOERROR then workingDir^:=string(PChar(workingDir^))
      else                                                                workingDir^:='';
  end;
end;

initialization
  if NeedToUninitialize then CoUninitialize;
finalization
end.

Regards, Madshi.

P.S: You'll need at least Delphi 3...
0
 

Author Comment

by:NYang
ID: 1344447
Madshi,

You are very helpful, thank you so much.

NYang
0
 
LVL 20

Expert Comment

by:Madshi
ID: 1344448
Just glad to have helped you...   :-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question