ZhAPI.pas 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. unit ZhAPI;
  2. interface
  3. uses Classes, DB, Controls;
  4. //procedure ShowWarningMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowWarningMessage';
  5. //procedure ShowTipMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowTipMessage';
  6. //procedure ShowErrorMessage(const AMsg: string); stdcall; external 'ZhAPI.dll' name 'ShowErrorMessage';
  7. //function ShowQuestMessage(const AMsg: string): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowQuestMessage';
  8. function ShowInputQuery(const ACaption, APrompt: string; var Value: string; ANeedMark: Boolean = False): Boolean; stdcall; external 'ZhAPI.dll' name 'ShowInputQuery';
  9. function ShowInputBox(const ACaption, APrompt, ADefault: string): string; stdcall; external 'ZhAPI.dll' name 'ShowInputBox';
  10. procedure ClearObjects(AList: TList); stdcall; external 'ZhAPI.dll' name 'ClearObjects';
  11. procedure ClearPointers(AList: TList); stdcall; external 'ZhAPI.dll' name 'ClearPointers';
  12. function ExtractSimpleFileName(const AFileName: string): string; stdcall; external 'ZhAPI.dll' name 'ExtractSimpleFileName';
  13. function CheckFileNameLegal(const AFileName: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckFileNameLegal';
  14. function CheckFileNameKeyLegal(var Key: Char): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckFileNameKeyLegal';
  15. function DeleteFileOrFolder(const AFileName: string; AToRecycleBin: Boolean = False): Boolean; stdcall; external 'ZhAPI.dll' name 'DeleteFileOrFolder';
  16. function CopyFileOrFolder(const ASrcFile, ADestFile: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CopyFileOrFolder';
  17. function CopyFileWithDirectory(const ASrcFile, ADestFile: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CopyFileWithDirectory';
  18. procedure CreateDirectoryInDeep(const ADir: string); stdcall; external 'ZhAPI.dll' name 'CreateDirectoryInDeep';
  19. function MoveFileOrFolder(const ASrcFile, ADestFile: string): Boolean; stdcall; external 'ZhAPI.dll' name 'MoveFileOrFolder';
  20. function GetExeFileVersion(const AExeName: string): string; stdcall; external 'ZhAPI.dll' name 'GetExeFileVersion';
  21. function ReadAppPathFromRegistry(const AKeyItem: string): string; stdcall; external 'ZhAPI.dll' name 'ReadAppPathFromRegistry';
  22. function GetDestTopDir: string; stdcall; external 'ZhAPI.dll' name 'GetDestTopDir';
  23. function GetFileSize(const AFileName: string): Int64; stdcall; external 'ZhAPI.dll' name 'GetFileSize';
  24. function GetFolderSize(ADir: string): Int64; stdcall; external 'ZhAPI.dll' name 'GetFolderSize';
  25. procedure FilterFiles(ADir, AExt: string; AFiles: TStrings); stdcall; external 'ZhAPI.dll' name 'FilterFiles';
  26. procedure FilterFilesRecursive(APath, AExt: string; FileList: TStrings); stdcall; external 'ZhAPI.dll' name 'FilterFilesRecursive';
  27. function GetPrefixOfCode(const ACode: string; ADelimiter: Char = '-'): string; stdcall; external 'ZhAPI.dll' name 'GetPrefixOfCode';
  28. function GetLastSetmentOfCode(const ACode: string; ADelimiter: Char = '-'): string; stdcall; external 'ZhAPI.dll' name 'GetLastSetmentOfCode';
  29. procedure DivideCodeIntoSubs(AStrings: TStrings; const ACode: string); stdcall; external 'ZhAPI.dll' name 'DivideCodeIntoSubs';
  30. function ReplaceCodePrefix(const ASubCode, ACode: string; ADelimiter: Char = '-'): string; stdcall; external 'ZhAPI.dll' name 'ReplaceCodePrefix';
  31. function CompareCode(const ACode1, ACode2: string; ADelimiter: Char = '-'): Integer; stdcall; external 'ZhAPI.dll' name 'CompareCode';
  32. function ConvertSmartSimSun(const AText: string): string; stdcall; external 'ZhAPI.dll' name 'ConvertSmartSimSun';
  33. procedure ExecuteFile(const AFileName: string); stdcall; external 'ZhAPI.dll' name 'ExecuteFile';
  34. function AdvRoundTo(AValue: Double; ADigit: Integer = -2): Double; stdcall; external 'ZhAPI.dll' name 'AdvRoundTo';
  35. procedure ClearDataSet(ADataSet: TDataSet); stdcall; external 'ZhAPI.dll' name 'ClearDataSet';
  36. function GetNewIDOfIndex(ADataSet: TDataSet): Integer; stdcall; external 'ZhAPI.dll' name 'GetNewIDOfIndex';
  37. function GetNewIDNoIndex(ADataSet: TDataSet): Integer; stdcall; external 'ZhAPI.dll' name 'GetNewIDNoIndex';
  38. function GetFieldValueDefault(ADataSet: TDataSet; const AFieldName: string; ADefault: Variant): Variant; stdcall; external 'ZhAPI.dll' name 'GetFieldValueDefault';
  39. function CheckStringNull(const AText: string; ATrim: Boolean = False): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckStringNull';
  40. function CheckZero(const AText: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckZero';
  41. function CheckNumeric(const AText: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckNumeric';
  42. function CheckWideString(const AText: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckWideString';
  43. function GetRandomString(ALength: Integer): string; stdcall; external 'ZhAPI.dll' name 'GetRandomString';
  44. function TrimSpaceReturnTabChar(const AText: string): string; stdcall external 'ZhAPI.dll' name 'TrimSpaceReturnTabChar';
  45. function EvaluateExprs(AExpression: string): Double; stdcall; external 'ZhAPI.dll' name 'EvaluateExprs';
  46. function VarToInt(const Value: Variant): Integer; stdcall; external 'ZhAPI.dll' name 'VarToInt';
  47. function VarToIntDef(const Value: Variant; ADefault: Integer): Integer; stdcall; external 'ZhAPI.dll' name 'VarToIntDef';
  48. function VarToFloat(const Value: Variant): Double; stdcall; external 'ZhAPI.dll' name 'VarToFloat';
  49. function VarToFloatDef(const Value: Variant; ADefault: Double): Double; stdcall; external 'ZhAPI.dll' name 'VarToFloatDef';
  50. function ConvertFloatToVar(AValue: Double): Variant; stdcall; external 'ZhAPI.dll' name 'ConvertFloatToVar';
  51. function ConvertStrToVar(const AValue: string): Variant; stdcall; external 'ZhAPI.dll' name 'ConvertStrToVar';
  52. function CheckStringUnStrictly(const S1, S2: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CheckStringUnStrictly';
  53. function GetWindowsOSVersion: Integer; stdcall; external 'ZhAPI.dll' name 'GetWindowsOSVersion';
  54. function CompressFolder(AFolder, AExt, AFile: string): Boolean; stdcall; external 'ZhAPI.dll' name 'CompressFolder';
  55. function DecompressFile(AFile, ADestPath: string): Boolean; stdcall; external 'ZhAPI.dll' name 'DecompressFile';
  56. function ConvertDigitCode(const ACode: string; ASegLen: Integer; ADelimiter: Char = '-'): string; stdcall; external 'ZhAPI.dll' name 'ConvertDigitCode';
  57. implementation
  58. end.