我是靠谱客的博主 霸气摩托,这篇文章主要介绍Delphi修改操作注册表权限的代码,现在分享给大家,希望可以做个参考。

需要uses jclwin32, AccCtrl; 此文件需要安装JCL

复制代码 代码如下:

function AllowRegKeyForEveryone(Key: HKEY; Path: string): Boolean;
var
WidePath: PWideChar;
Len: Integer;
begin
case Key of
HKEY_LOCAL_MACHINE:
Path := 'MACHINE' + Path;
HKEY_CURRENT_USER:
Path := 'CURRENT_USER' + Path;
HKEY_CLASSES_ROOT:
Path := 'CLASSES_ROOT' + Path;
HKEY_USERS:
Path := 'USERS' + Path;
end;
Len := (Length(Path)+1)*SizeOf(WideChar);
GetMem(WidePath,Len);
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, PChar(Path), -1, WidePath, Len);
Result := SetNamedSecurityInfoW(WidePath, SE_REGISTRY_KEY,
DACL_SECURITY_INFORMATION, nil, nil, nil, nil) = ERROR_SUCCESS;
FreeMem(WidePath);
end;

最后

以上就是霸气摩托最近收集整理的关于Delphi修改操作注册表权限的代码的全部内容,更多相关Delphi修改操作注册表权限内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(125)

评论列表共有 0 条评论

立即
投稿
返回
顶部