2007. március 16., péntek

Read the content of Internet Explorer's "History" folder


Problem/Question/Abstract:

How can I delete the contents of the IE5 History folder? I know that it is a Special Folder, so do you need to run this process as the system? If so how?

Answer:

This will get you the history folder and then maybe you can use the DeleteFile function to delete all the files in the directory.

uses
  ShlObj;

procedure TForm1.Button1Click(Sender: TObject);
const
  CSIDL_HISTORY = $0022; {no need to define if using Delphi 5}
var
  pidl: PItemIDList;
  Path: array[0..MAX_PATH - 1] of char;
begin
  {get location of history folder}
  if SHGetSpecialFolderLocation(Self.Handle, CSIDL_HISTORY, pidl) = NOERROR then
  begin
    SHGetPathFromIDList(pidl, Path);
    ShowMessage(Path);
  end;
end;

Nincsenek megjegyzések:

Megjegyzés küldése