Solved

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

Posted on 2001-08-29
3
194 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
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: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Suggested Solutions

Title # Comments Views Activity
Simple Delphi Question 9 95
Communication Between RC4 Delphi <-> PHP 3 122
Create a path if not exists 7 86
Delphi problems to abort a printjob 9 24
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

789 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