?
Solved

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

Posted on 2001-08-29
3
Medium Priority
?
197 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 200 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

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!

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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