Solved

Deletion propmt for folders, and properties dialog for files/directorties

Posted on 2001-08-29
3
195 Views
Last Modified: 2010-04-06
Hi,
I want to delete a folder (not empty), is there any api that will call the default folder delete method(if any), not only this it should display the prompt for deltion to the recycle bin, as it shows for deleting files using "ShFileOperation".
Secondly i want to display the default windows property window for any file/folder. can anyone give me code for that.

Thanx in advance.

Hammad
0
Comment
Question by:hammadmajeed
[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 Comments
 
LVL 1

Expert Comment

by:tomer_engel
ID: 6437836
i'm sorry,i didint undarstand
i would love to help you but i didn't undarstand
0
 
LVL 34

Expert Comment

by:Slick812
ID: 6439150
why don't you just use the ShFileOperation ? ? You may want too much in a single fuction, with the recycle bin and all of that. I'm not sure I understand it all.
0
 
LVL 17

Accepted Solution

by:
inthe earned 50 total points
ID: 6439347
hi,
to display the default property sheet for a file or directory see:

http://www.delphifreestuff.com/cgi-bin/dfs_components2.cgi?itemprop

for the deleting of a directory with files can still use shfileoperation as it sounds like you have already have for files just pass the folder name as below:
(note this will send it to recycle bin and display the windows dialog asking if can delete)

uses
ShellApi;

procedure Deltree(folder : pchar);
var
  T:TSHFileOpStruct;
  X: Integer;
begin
    with T do
    begin
      Wnd:=0;
      wFunc:=FO_DELETE;
      pFrom:= folder;
      fFlags:= FOF_ALLOWUNDO or FOF_SILENT ;
     end;
    SHFileOperation(T);
end;


procedure TForm1.Button1Click(Sender: TObject);
begin
Deltree('c:\testdir');
end;
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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