Solved

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

Posted on 2001-08-29
3
191 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
Comment Utility
i'm sorry,i didint undarstand
i would love to help you but i didn't undarstand
0
 
LVL 33

Expert Comment

by:Slick812
Comment Utility
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
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

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…
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…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now