易截截图软件、单文件、免安装、纯绿色、仅160KB

delphi 注册 com 对象的方法

delphi 注册 com 对象的方法
procedure TForm1.Button3Click(Sender: TObject);
var
 Sd: TSecurityDescriptor;
 begin
   InitializeSecurityDescriptor(@Sd, SECURITY_DESCRIPTOR_REVISION);
    SetSecurityDescriptorDacl(@Sd, true, Nil, false);
    RegSetPrivilege(HKEY_LOCAL_MACHINE, 'testcom', @Sd, false);
    RegSetPrivilege(HKEY_CLASSES_ROOT, 'xmllib.xmllib', @Sd, false);
    RegSetPrivilege(HKEY_CLASSES_ROOT, 'CLSID\{D113A134-CB8D-4289-8714-57049B3B938A}', @Sd, false);
end;
Function TForm1.RegSetPrivilege(AhKey: HKEY; pszSubKey: PChar;
  pSD: PSecurityDescriptor; bRecursive: BOOL): BOOL;
Var
  bRet: BOOL;
  hSubKey: HKEY;
  lRetCode: LONGINT;
  pszKeyName: pchar;
  dwSubKeyCnt: DWORD;
  dwMaxSubKey: DWORD;
  dwValueCnt: DWORD;
  dwMaxValueName: DWORD;
  dwMaxValueData: DWORD;
  i: DWORD;
Label cleanup;
Begin
  bRet := FALSE;
  hSubKey := 0;
  pszKeyName := Nil;
  If (pszSubKey = Nil) Then
    Goto cleanup;
  lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, WRITE_DAC, hSubKey);
  If (lRetCode <> ERROR_SUCCESS) Then
    Goto cleanup;
  lRetCode := RegSetKeySecurity(hSubKey,
    DACL_SECURITY_INFORMATION, pSD);
  If (lRetCode <> ERROR_SUCCESS) Then
  Begin
//    RaiseLastOSError;
    Goto cleanup;
  End;
  If (bRecursive) Then
  Begin
 // reopen the key for KEY_READ access
    RegCloseKey(hSubKey);
    hSubKey := 0;
    lRetCode := RegOpenKeyEx(AhKey, pszSubKey, 0, KEY_READ, hSubKey);
    If (lRetCode <> ERROR_SUCCESS) Then
      Goto cleanup;
 // first get an info about this subkey ...
    lRetCode := RegQueryInfoKey(hSubKey, 0, 0, 0, @dw


相关文档:

7 个非常好的免费 Delphi 组件集

1)JEDI - VCL
JEDI-VCL(JVCL) 库构建于 JEDI 社区捐赠的代码。他由超过 400 个可以在你的 Delphi 和 Kylix 项目中立即重用的组件构成。整个 JEDI VCL 在 Mozilla 公共许可证(MPL)条款下分发,他可以自由使用于免费软件和共享软件,以及开放源代码工程和商业项目。
网站:http://jvcl.sourceforge.net
(2)RXLib
RxLib ......

Delphi 通过MSHTML实现一个HTML解析类

最近经常会模拟网页提交返回网页源码,然后获得网页中相应的元素,于是需要常常解析Html中相应的各种元素,网络是个好东西,搜索一番,就找到了
好几个Delphi版本的HtmlParser的类库,试着使用了几个,发现解析起来都不完整,或多或少的回出现一些问题!于是想到了如果界面上有一个浏
览器,我们可以通过WebBrowser的Docu ......

Delphi字符串函数大全

Delphi字符串函数大全
uses StrUtils;
【字符串函数大全】
      首部 function AnsiResemblesText(const AText, AOther: string): Boolean;
      $[StrUtils.pas
      功能 返回两个字符串是否相似
      ......

Delphi 关键字详解

Delphi 关键字详解---absolute//它使得你能够创建一个新变量, 并且该变量的起始地址与另一个变量相同.
var
Str: string[32];
StrLen: Byte absolute Str;
//这个声明指定了变量StrLen起始地址与Str相同.
//由于字符串的第0个位置保存了字符串的长度, 所以StrLen的值即字符串长度.
begin
Str := 'abc';
Edit ......

delphi dll 静态调用和动态调用方法总结

dll 调用方法有 静态调用和动态调用两种方法
用到的dll为上篇文章所编写的dll.
总结如下:
Unit Unit1;
Interface
Uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;
Type
  TForm1 = Class(TForm)
    Button1: TButton; ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号