亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tvapithing.pas

?? delphi中各種API函數的實現
?? PAS
?? 第 1 頁 / 共 3 頁
字號:
(*
   tvAPIThing

   Primary Author: Tim Victor - tvictor@erols.com
   With the help of the following:
      Wolfgang Wendefeuer
      William A. Portillo

   Version History

   1.00 17Aug1997 - Original
   1.01 14Sep1997 - Added disk formatting/GlobalMemoryStatus/ExitWindows,
                    with the input of Wolfgang Wendefeuer recoded the unit to
                    minimize compiler warning and tips
   1.1  11Nov1997 - Added properties to correspond to all fields in the
                    SYSTEM_INFO structure.
   1.2  26Dec1997 - Added Network dis/connection functions
   4.0  05Aug1998 - Upgraded component to D4

*)


unit tvAPIThing;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, ShellAPI, Forms, Dialogs;

type
  TInformationStrings = ( isCompanyName,  isFileDescription, isFileVersion,
                          isInternalName, isLegalCopyright,  isOriginalFilename,
                          isProductName,  isProductVersion,  isComments,
                          isLegalTrademarks );

  TFileTimeComparision = ( ftError, ftFileOneIsOlder, ftFileTimesAreEqual, ftFileTwoIsOlder );

  TTimeOfWhat = ( ftCreationTime, ftLastAccessTime, ftLastWriteTime );

  TDriveType = (dtUnknown, dtNoDrive, dtFloppy, dtFixed, dtNetwork, dtCDROM, dtRAM);

  TVolumeInfo = record
     Name               : String;
     SerialNumber       : DWORD;
     MaxComponentLength : DWORD;
     FileSystemFlags    : DWORD;
     FileSystemName     : String;
  end; // TVolumeInfo

  type
  PFixedFileInfo = ^TFixedFileInfo;
  TFixedFileInfo = record
     dwSignature       : DWORD;
     dwStrucVersion    : DWORD;
     wFileVersionMS    : WORD;  // Minor Version
     wFileVersionLS    : WORD;  // Major Version
     wProductVersionMS : WORD;  // Build Number
     wProductVersionLS : WORD;  // Release Version
     dwFileFlagsMask   : DWORD;
     dwFileFlags       : DWORD;
     dwFileOS          : DWORD;
     dwFileType        : DWORD;
     dwFileSubtype     : DWORD;
     dwFileDateMS      : DWORD;
     dwFileDateLS      : DWORD;
  end; // TFixedFileInfo

  TtvAPIThing = class( TComponent )
  private
    // System Information
    function myGetUserName            : String;
    function myGetComputerName        : String;
    function myGetWindowsDirectory    : String;
    function myGetSystemDirectory     : String;
    // Time Functions
    function myGetSystemTime          : String;
    function myGetLocalTime           : String;

    // File Functions
    function myGetCurrentDirectory                                                  : String;
    function myGetTempPath                                                          : String;
    function myGetLogicalDrives                                                     : String;

    function myGetFileTime( const FileName : String; ComparisonType : TTimeOfWhat ) : TFileTime;
    function myGetVersion                                                           : String;
    function myGlobalMemoryStatus( const Index : Integer )                          : DWORD;

    function myGetSystemInfoWORD( const Index : Integer )                           : WORD;
    function myGetSystemInfoDWORD( const Index : Integer )                          : DWORD;
    // Removed for D4
    function myGetSystemInfoPtr( const Index : Integer )                            : Pointer;

    function SystemTimeToDateTime(const SystemTime: TSystemTime)                    : TDateTime;
  protected

  public
    function GetFileInformation(    const FileName, Value : String ): String;
    function CompareFileTime(       const FileNameOne, FileNameTwo : String; ComparisonType : TTimeOfWhat ): TFileTimeComparision;
    function GetFileTime(           const FileName : String; ComparisonType : TTimeOfWhat ): TDateTime;
    function FileInfo(              const FileName : String ) : TFixedFileInfo;
    function ExtractIcon(           const FileName : String ): HIcon;
    function ExtractAssociatedIcon( const FileName : String ): HIcon;
    function GetFreeDiskSpace(      const Drive : Char ) : LongInt;
    function FileSize(              const FileName : String ) : LongInt;
    function GetShortPathName(      const Path : String ): String;
    function GetFullPathName(       const Path : String ): String;
    function GetVolumeInformation(  const Drive : Char ) : TVolumeInfo;
    function FindExecutable(        const FileName : String ): String;
    function DriveType(             const Drive : Char ) : TDriveType;
    function DisconnectNetworkDrive( const Drive : Char ): Boolean;
    function AddNetworkDrive( const Resource : String; const Drive : Char ): Boolean;
    function GetUniversalName( const Drive : Char ): String;

    procedure ShellAbout( const TitleBar, OtherText : String );
    procedure FormatDrive( const Drive : Char );
    procedure ShutDown;

    // Pointer Fields
    // D4 won't allow them to be published attributes
    property lpMinimumApplicationAddress : Pointer index 1 read myGetSystemInfoPtr;
    property lpMaximumApplicationAddress : Pointer index 2 read myGetSystemInfoPtr;
  published
    // System Information
    property UserName               : String read myGetUserName;
    property ComputerName           : String read myGetComputerName;
    property WindowsDirectory       : String read myGetWindowsDirectory;
    property SystemDirectory        : String read myGetSystemDirectory;
    // Time Functions
    property SystemTime             : String read myGetSystemTime;
    property LocalTime              : String read myGetLocalTime;
    // File Functions
    property CurrentDirectory       : String read myGetCurrentDirectory;
    property TempPath               : String read myGetTempPath;
    property LogicalDrives          : String read myGetLogicalDrives;
    property OSVersion              : String read myGetVersion;
    // From GlobalMemoryStatus
    property dwMemoryLoad           : DWORD index 1 read myGlobalMemoryStatus;
    property dwTotalPhys            : DWORD index 2 read myGlobalMemoryStatus;
    property dwAvailPhys            : DWORD index 3 read myGlobalMemoryStatus;
    property dwTotalPageFile        : DWORD index 4 read myGlobalMemoryStatus;
    property dwAvailPageFile        : DWORD index 5 read myGlobalMemoryStatus;
    property dwTotalVirtual         : DWORD index 6 read myGlobalMemoryStatus;
    property dwAvailVirtual         : DWORD index 7 read myGlobalMemoryStatus;

    // TSystemInfo
    // WORD Fields
    property ProcessorArchitecture       : WORD index 1 read myGetSystemInfoWORD;
    property ProcessorLevel              : WORD index 2 read myGetSystemInfoWORD;
    property ProcessorRevision           : WORD index 3 read myGetSystemInfoWORD;
    // DWORD Fields
    property PageSize                    : DWORD index 1 read myGetSystemInfoDWORD;
    property ActiveProcessorMask         : DWORD index 2 read myGetSystemInfoDWORD;
    property NumberOfProcessors          : DWORD index 3 read myGetSystemInfoDWORD;
    property ProcessorType               : DWORD index 4 read myGetSystemInfoDWORD;
    property AllocationGranularity       : DWORD index 5 read myGetSystemInfoDWORD;

  end;

  procedure Register;

const
   PROCESSOR_INTEL_386     = 386;
   PROCESSOR_INTEL_486     = 486;
   PROCESSOR_INTEL_PENTIUM = 586;
   PROCESSOR_MIPS_R4000    = 4000;
   PROCESSOR_ALPHA_21064   = 21064;

function SHFormatDrive(hWnd : HWND;Drive, fmtID, Options : WORD) : longint; stdcall; external  'shell32.dll';

implementation

// Goes right after the VS_FIXEDFILEINFO structure
function TtvAPIThing.FileInfo( const FileName :String ) : TFixedFileInfo;
var
  dwHandle, dwVersionSize : DWORD;
  strSubBlock             : String;
  pTemp                   : Pointer;
  pData                   : Pointer;
begin
   strSubBlock := '\';

   // get version information values
   dwVersionSize := GetFileVersionInfoSize( PChar( FileName ), // pointer to filename string
                                            dwHandle );        // pointer to variable to receive zero

   // if GetFileVersionInfoSize is successful
   if dwVersionSize <> 0 then
   begin
      GetMem( pTemp, dwVersionSize );
      try
         if GetFileVersionInfo( PChar( FileName ),             // pointer to filename string
                                dwHandle,                      // ignored
                                dwVersionSize,                 // size of buffer
                                pTemp ) then                   // pointer to buffer to receive file-version info.

            if VerQueryValue( pTemp,                           // pBlock     - address of buffer for version resource
                              PChar( strSubBlock ),            // lpSubBlock - address of value to retrieve
                              pData,                           // lplpBuffer - address of buffer for version pointer
                              dwVersionSize ) then             // puLen      - address of version-value length buffer
               Result := PFixedFileInfo( pData )^;
      finally
         FreeMem( pTemp );
      end; // try
   end; // if dwVersionSize
end;

function TtvAPIThing.GetFileInformation( const FileName, Value : String ): String;
var
  dwHandle, dwVersionSize   : DWORD;
  strLangCharSetInfoString  : String;
  pcBuffer                  : PChar;
  pTemp                     : Pointer;
begin
   //////////////////////////////////////////////////////////////////////////////////
   // The Win32 API contains the following predefined version information strings: //
   //////////////////////////////////////////////////////////////////////////////////
   //    CompanyName               FileDescription          FileVersion            //
   //    InternalName              LegalCopyright           OriginalFilename       //
   //    ProductName               ProductVersion           Comments               //
   //    LegalTrademarks                                                           //
   //////////////////////////////////////////////////////////////////////////////////

   //////////////////////////////////////////////////////////////////////////////////
   // Decription of lpSubBlock from the Win32 API (sLangCharSet)                   //
   //////////////////////////////////////////////////////////////////////////////////
   // Specifies a value in a language-specific structure. The lang-charset name is //
   // a concatenation of a language and character-set identifier pair found in the //
   // translation table for the resource. The lang-charset name must be specified  //
   // as a hexadecimal string. The string-name name is one of the predefined       //
   // strings described in the following Remarks section.                          //
   //////////////////////////////////////////////////////////////////////////////////

   strLangCharSetInfoString := '\StringFileInfo\040904E4\' + Value;

   // get version information values
   dwVersionSize := GetFileVersionInfoSize( PChar( FileName ),   // pointer to filename string
                                            dwHandle );          // pointer to variable to receive zero

   // if GetFileVersionInfoSize is successful
   if dwVersionSize <> 0 then
   begin
      GetMem( pcBuffer, dwVersionSize );
      try
         if GetFileVersionInfo( PChar( FileName ),               // pointer to filename string
                                dwHandle,                        // ignored
                                dwVersionSize,                   // size of buffer
                                pcBuffer ) then                  // pointer to buffer to receive file-version info.

            if VerQueryValue( pcBuffer,                          // pBlock     - address of buffer for version resource
                              PChar( strLangCharSetInfoString ), // lpSubBlock - address of value to retrieve
                              pTemp,                             // lplpBuffer - address of buffer for version pointer
                              dwVersionSize ) then               // puLen      - address of version-value length buffer

               Result := PChar( pTemp );
      finally
         FreeMem( pcBuffer );
      end; // try
   end;// if dwVersionSize
end; // GetFileInformation

function TtvAPIThing.myGetUserName : String;
var
   pcUser   : PChar;
   dwUSize : DWORD;
begin
   dwUSize := 21; // user name can be up to 20 characters
   GetMem( pcUser, dwUSize ); // allocate memory for the string
   try
      if Windows.GetUserName( pcUser, dwUSize ) then
         Result := pcUser
   finally
      FreeMem( pcUser ); // now free the memory allocated for the string
   end;
end;

function TtvAPIThing.myGetComputerName : String;
var
   pcComputer : PChar;
   dwCSize    : DWORD;
begin
   dwCSize := MAX_COMPUTERNAME_LENGTH + 1;
   GetMem( pcComputer, dwCSize ); // allocate memory for the string
   try
      if Windows.GetComputerName( pcComputer, dwCSize ) then
         Result := pcComputer;
   finally
      FreeMem( pcComputer ); // now free the memory allocated for the string
   end;
end;

function TtvAPIThing.myGetWindowsDirectory : String;
var
   pcWindowsDirectory : PChar;
   dwWDSize           : DWORD;
begin
   dwWDSize := MAX_PATH + 1;
   GetMem( pcWindowsDirectory, dwWDSize ); // allocate memory for the string
   try
      if Windows.GetWindowsDirectory( pcWindowsDirectory, dwWDSize ) <> 0 then
         Result := pcWindowsDirectory;
   finally
      FreeMem( pcWindowsDirectory ); // now free the memory allocated for the string
   end;
end;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品人人做人人爽人人添| 欧洲色大大久久| 欧美tickling挠脚心丨vk| 久久成人综合网| 久久一区二区视频| 国产成人一区在线| 亚洲人妖av一区二区| www.在线成人| 亚洲一区二区三区视频在线播放| 欧美撒尿777hd撒尿| 日本v片在线高清不卡在线观看| 日韩欧美一卡二卡| 国产成人免费视| 亚洲天堂2014| 欧美一区二区三区啪啪| 国产乱码精品一区二区三区av | 国产成人自拍在线| 91日韩在线专区| 亚洲狠狠爱一区二区三区| 69久久99精品久久久久婷婷| 国产乱码精品一区二区三区忘忧草 | 亚洲乱码精品一二三四区日韩在线| 欧美偷拍一区二区| 狠狠色狠狠色综合日日91app| 中文字幕乱码亚洲精品一区| 在线观看日韩国产| 国产一区二区免费视频| 亚洲电影一级片| 久久―日本道色综合久久| 91色.com| 国产美女精品一区二区三区| 亚洲国产综合色| 久久综合色鬼综合色| 91黄色在线观看| 国产精品自拍av| 亚洲18色成人| 国产精品乱码一区二三区小蝌蚪| 欧美高清激情brazzers| 国产电影一区二区三区| 性感美女久久精品| 1024国产精品| xfplay精品久久| 欧美日韩免费一区二区三区 | 99re视频这里只有精品| 一区二区视频在线| 国产亚洲美州欧州综合国| 91精品国产欧美一区二区| 91网站最新地址| 国产suv精品一区二区6| 日本欧美韩国一区三区| 亚洲综合图片区| 中文字幕在线免费不卡| 久久久不卡影院| 欧美一区二区私人影院日本| 欧美伊人久久大香线蕉综合69| 国产精品 欧美精品| 久久不见久久见中文字幕免费| 亚洲国产一区二区三区青草影视| 国产精品久久久久久久久快鸭| 亚洲精品在线免费播放| 91精品一区二区三区在线观看| 色一区在线观看| 91在线免费播放| 99精品视频一区二区三区| 国产不卡视频在线播放| 国产精品伊人色| 国产在线不卡视频| 国产一区在线不卡| 精品一区二区在线观看| 麻豆成人免费电影| 免费一区二区视频| 蜜乳av一区二区| 免费看欧美女人艹b| 天堂av在线一区| 蜜臀av一区二区在线免费观看| 午夜欧美大尺度福利影院在线看| 亚洲一区二区三区在线| 一区二区三区毛片| 亚洲国产精品久久久男人的天堂| 亚洲精品精品亚洲| 亚洲自拍都市欧美小说| 亚洲成av人片在线观看| 日本最新不卡在线| 人人狠狠综合久久亚洲| 久久av老司机精品网站导航| 国模一区二区三区白浆| 国产成人福利片| aaa欧美大片| 一本一道久久a久久精品| 色噜噜偷拍精品综合在线| 91福利社在线观看| 欧美一区二区在线观看| 日韩精品一区二区三区在线观看| 精品不卡在线视频| 中文字幕免费不卡| 一区二区激情小说| 青青草视频一区| 粉嫩一区二区三区性色av| 99免费精品视频| 在线视频综合导航| 91精品国产综合久久国产大片| 亚洲精品一线二线三线| 国产精品久久久久婷婷| 亚欧色一区w666天堂| 国产永久精品大片wwwapp | 国产在线麻豆精品观看| 丁香另类激情小说| 欧美专区日韩专区| 91精品国产色综合久久不卡电影 | 日韩高清欧美激情| 国产精品一二一区| 在线观看免费亚洲| 精品电影一区二区| 夜夜嗨av一区二区三区四季av| 日韩高清欧美激情| 99精品一区二区| 日韩免费观看2025年上映的电影| 欧美国产精品一区二区| 手机精品视频在线观看| 国产aⅴ精品一区二区三区色成熟| 91麻豆国产精品久久| 精品国产91久久久久久久妲己| 国产精品超碰97尤物18| 蜜臀av性久久久久蜜臀aⅴ流畅| 成人av综合一区| 欧美不卡一二三| 亚洲国产综合91精品麻豆| 国产成人午夜片在线观看高清观看| 在线视频国内自拍亚洲视频| 久久综合999| 日韩国产在线一| 91麻豆免费观看| 日本一区二区高清| 美女网站在线免费欧美精品| 色呦呦日韩精品| 日本一区二区三区国色天香| 午夜激情一区二区三区| 一本色道**综合亚洲精品蜜桃冫| 欧美成va人片在线观看| 视频一区视频二区中文字幕| 99久久99久久精品免费观看| 久久久久国产精品麻豆ai换脸| 天天综合色天天| 欧美在线你懂得| 亚洲欧美激情一区二区| 成年人网站91| 中文字幕国产一区| 国产黄色成人av| 欧美tk—视频vk| 日本美女一区二区| 欧美人妖巨大在线| 亚洲线精品一区二区三区| av色综合久久天堂av综合| 欧美国产精品专区| 国产99久久久久久免费看农村| 久久综合色一综合色88| 极品少妇xxxx偷拍精品少妇| 日韩一区和二区| 蜜臀国产一区二区三区在线播放| 欧美私人免费视频| 亚洲成人一二三| 色哟哟亚洲精品| 亚洲欧美日韩中文播放| 99精品视频一区二区三区| 亚洲欧洲精品天堂一级| 97超碰欧美中文字幕| 国产精品国产三级国产aⅴ入口| 国产激情一区二区三区四区| 久久亚洲精品小早川怜子| 韩国成人在线视频| 欧美精品一区二区三区蜜桃视频 | 91麻豆精品国产91久久久 | 欧美三电影在线| 亚洲成人777| 欧美精品在线观看一区二区| 日韩av不卡在线观看| 欧美不卡一二三| 国产一区二区免费在线| 欧美国产精品久久| 日本高清无吗v一区| 丝袜美腿成人在线| 久久综合久久综合亚洲| 懂色av一区二区夜夜嗨| 亚洲天堂免费在线观看视频| 欧美性感一区二区三区| 日日夜夜精品视频天天综合网| 欧美一区二区在线看| 国产黄人亚洲片| 亚洲视频精选在线| 88在线观看91蜜桃国自产| 久久99热这里只有精品| 中文字幕欧美三区| 欧美午夜一区二区三区| 久久er99热精品一区二区| 国产精品免费视频网站| 欧美日韩久久不卡| 国产一区二区在线影院| 亚洲精品视频在线看| 欧美一级夜夜爽| 国产精品2024|