Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials
Register FAQ Community Calendar Today's Posts Search

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 14-10-2023, 09:20
hitman797's Avatar
hitman797 hitman797 is offline
Registered User
 
Join Date: Feb 2013
Location: Algeria
Posts: 168
Thanks: 486
Thanked 202 Times in 122 Posts
hitman797 is on a distinguished road
Quote:
Originally Posted by Jahan1373 View Post
https://www.mediafire.com/file/2cddc...rpack.rar/file

Hello, I visited the site about the installation of the metro for almost a year, but it was not as good as this one, but it has problems and it is still not complete. I hope that this movie will solve some problems.
...get the number of Files in the Recycle Bin and their total size?
Code:
	 	  
type
  PSHQueryRBInfo = ^TSHQueryRBInfo;
  TSHQueryRBInfo = packed record
    cbSize: DWORD;
    // Size of the structure, in bytes.
    // This member must be filled in prior to calling the function.
    i64Size: Int64;
    // Total size of all the objects in the specified Recycle Bin, in bytes.
    i64NumItems: Int64;
    // Total number of items in the specified Recycle Bin.
  end;

const
  shell32 = 'shell32.dll';

function SHQueryRecycleBin(szRootPath: PChar; SHQueryRBInfo: PSHQueryRBInfo): HResult;
  stdcall; external shell32 Name 'SHQueryRecycleBinA';

function GetDllVersion(FileName: string): Integer;
var
  InfoSize, Wnd: DWORD;
  VerBuf: Pointer;
  FI: PVSFixedFileInfo;
  VerSize: DWORD;
begin
  Result   := 0;
  InfoSize := GetFileVersionInfoSize(PChar(FileName), Wnd);
  if InfoSize <> 0 then
  begin
    GetMem(VerBuf, InfoSize);
    try
      if GetFileVersionInfo(PChar(FileName), Wnd, InfoSize, VerBuf) then
        if VerQueryValue(VerBuf, '\', Pointer(FI), VerSize) then
          Result := FI.dwFileVersionMS;
    finally
      FreeMem(VerBuf);
    end;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var
  DllVersion: integer;
  SHQueryRBInfo: TSHQueryRBInfo;
  r: HResult;
begin
  DllVersion := GetDllVersion(PChar(shell32));
  if DllVersion >= $00040048 then
  begin
    FillChar(SHQueryRBInfo, SizeOf(TSHQueryRBInfo), #0);
    SHQueryRBInfo.cbSize := SizeOf(TSHQueryRBInfo);
    R := SHQueryRecycleBin(nil, @SHQueryRBInfo);
    if r = s_OK then
    begin
      label1.Caption := Format('Size:%d Items:%d',
        [SHQueryRBInfo.i64Size, SHQueryRBInfo.i64NumItems]);
    end
    else
      label1.Caption := Format('Err:%x', [r]);
  end;
end;

{
The SHQueryRecycleBin API used in this method is
only available on systems with the latest shell32.dll installed with IE4 /
Active Desktop.
}
Reply With Quote
The Following 2 Users Say Thank You to hitman797 For This Useful Post:
audiofeel (15-10-2023), Behnam2018 (14-10-2023)
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Windows Fluent Effects Standalone API - InnoSetup / VCL / FXM BLACKFIRE69 Conversion Tutorials 0 15-11-2023 17:35
Windows Phone Installer similar to razor12911's original design? Kitsune1982 Conversion Tutorials 0 02-07-2020 13:04
INDEX - Conversion Tutorial Index Razor12911 Conversion Tutorials 5 11-06-2020 02:05
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48



All times are GMT -7. The time now is 00:48.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com