Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

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

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

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…
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…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

636 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