CnASCommon.pas 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {******************************************************************************}
  2. { CnPack For Delphi/C++Builder }
  3. { 中国人自己的开放源码第三方开发包 }
  4. { (C)Copyright 2001-2018 CnPack 开发组 }
  5. { ------------------------------------ }
  6. { }
  7. { 本开发包是开源的自由软件,您可以遵照 CnPack 的发布协议来修 }
  8. { 改和重新发布这一程序。 }
  9. { }
  10. { 发布这一开发包的目的是希望它有用,但没有任何担保。甚至没有 }
  11. { 适合特定目的而隐含的担保。更详细的情况请参阅 CnPack 发布协议。 }
  12. { }
  13. { 您应该已经和开发包一起收到一份 CnPack 发布协议的副本。如果 }
  14. { 还没有,可访问我们的网站: }
  15. { }
  16. { 网站地址:http://www.cnpack.org }
  17. { 电子邮件:master@cnpack.org }
  18. { }
  19. {******************************************************************************}
  20. unit CnASCommon;
  21. {* |<PRE>
  22. ================================================================================
  23. * 软件名称:不可视工具组件包
  24. * 单元名称:ActiveScript Host 服务单元
  25. * 单元作者:周劲羽 (zjy@cnpack.org)
  26. * 备 注:该单元定义了供 ActiveScript 使用的一些公共服务
  27. * 开发平台:PWin2K SP3 + Delphi 7
  28. * 兼容测试:PWin9X/2000/XP + Delphi 6/7 C++Builder 6
  29. * 本 地 化:该单元中的字符串均符合本地化处理方式
  30. * 单元标识:$Id$
  31. * 修改记录:2003.10.31
  32. * 创建单元
  33. ================================================================================
  34. |</PRE>}
  35. interface
  36. {$I CnPack.inc}
  37. uses
  38. Windows, SysUtils, Classes, Registry, IniFiles, CnASIDispatchProxy, CnCommon;
  39. type
  40. ICnASRegistry = interface(IActiveScriptInvokable)
  41. ['{428BFF29-68CC-4376-ACEB-16B4670CA920}']
  42. procedure CloseKey; stdcall;
  43. function CreateKey(const Key: string): Boolean; stdcall;
  44. function DeleteKey(const Key: string): Boolean; stdcall;
  45. function DeleteValue(const Name: string): Boolean; stdcall;
  46. function GetAccess: LongWord; stdcall;
  47. function GetCurrentKey: HKEY; stdcall;
  48. function GetCurrentPath: string; stdcall;
  49. function GetDataSize(const ValueName: string): Integer; stdcall;
  50. function GetDataType(const ValueName: string): TRegDataType; stdcall;
  51. function GetKeyNames: OleVariant; stdcall;
  52. function GetLazyWrite: Boolean; stdcall;
  53. function GetRootKey: HKEY; stdcall;
  54. function GetValueNames: OleVariant; stdcall;
  55. function HasSubKeys: Boolean; stdcall;
  56. function KeyExists(const Key: string): Boolean; stdcall;
  57. function LoadKey(const Key, FileName: string): Boolean; stdcall;
  58. procedure MoveKey(const OldName, NewName: string; Delete: Boolean); stdcall;
  59. function OpenKey(const Key: string; CanCreate: Boolean): Boolean; stdcall;
  60. function OpenKeyReadOnly(const Key: String): Boolean; stdcall;
  61. function ReadBinaryData(const Name: string): OleVariant; stdcall;
  62. function ReadBool(const Name: string): Boolean; stdcall;
  63. function ReadCurrency(const Name: string): Currency; stdcall;
  64. function ReadDate(const Name: string): TDateTime; stdcall;
  65. function ReadDateTime(const Name: string): TDateTime; stdcall;
  66. function ReadFloat(const Name: string): Double; stdcall;
  67. function ReadInteger(const Name: string): Integer; stdcall;
  68. function ReadString(const Name: string): string; stdcall;
  69. function ReadTime(const Name: string): TDateTime; stdcall;
  70. function RegistryConnect(const UNCName: string): Boolean; stdcall;
  71. procedure RenameValue(const OldName, NewName: string); stdcall;
  72. function ReplaceKey(const Key, FileName, BackUpFileName: string): Boolean; stdcall;
  73. function RestoreKey(const Key, FileName: string): Boolean; stdcall;
  74. function SaveKey(const Key, FileName: string): Boolean; stdcall;
  75. procedure SetAccess(const Value: LongWord); stdcall;
  76. procedure SetLazyWrite(const Value: Boolean); stdcall;
  77. procedure SetRootKey(const Value: HKEY); stdcall;
  78. function UnLoadKey(const Key: string): Boolean; stdcall;
  79. function ValueExists(const Name: string): Boolean; stdcall;
  80. procedure WriteBinaryData(const Name: string; Value: OleVariant); stdcall;
  81. procedure WriteBool(const Name: string; Value: Boolean); stdcall;
  82. procedure WriteCurrency(const Name: string; Value: Currency); stdcall;
  83. procedure WriteDate(const Name: string; Value: TDateTime); stdcall;
  84. procedure WriteDateTime(const Name: string; Value: TDateTime); stdcall;
  85. procedure WriteExpandString(const Name, Value: string); stdcall;
  86. procedure WriteFloat(const Name: string; Value: Double); stdcall;
  87. procedure WriteInteger(const Name: string; Value: Integer); stdcall;
  88. procedure WriteString(const Name, Value: string); stdcall;
  89. procedure WriteTime(const Name: string; Value: TDateTime); stdcall;
  90. property Access: LongWord read GetAccess write SetAccess;
  91. property CurrentKey: HKEY read GetCurrentKey;
  92. property CurrentPath: string read GetCurrentPath;
  93. property LazyWrite: Boolean read GetLazyWrite write SetLazyWrite;
  94. property RootKey: HKEY read GetRootKey write SetRootKey;
  95. end;
  96. implementation
  97. end.