parent
8928201744
commit
6b0f01b352
|
|
@ -4778,13 +4778,15 @@ type TRegKey = class
|
|||
{**
|
||||
@explan(说明) windows注册表操作类 %%
|
||||
**}
|
||||
static HKEY_CLASSES_ROOT;
|
||||
static HKEY_CURRENT_USER;
|
||||
static HKEY_LOCAL_MACHINE;
|
||||
static HKEY_USERS;
|
||||
static HKEY_PERFORMANCE_DATA;
|
||||
static HKEY_PERFORMANCE_TEXT;
|
||||
static HKEY_PERFORMANCE_NLSTEXT;
|
||||
static const HKEY_CLASSES_ROOT = 0x80000000;
|
||||
static const HKEY_CURRENT_USER = 0x80000001;
|
||||
static const HKEY_LOCAL_MACHINE = 0x80000002;
|
||||
static const HKEY_USERS = 0x80000003;
|
||||
static const HKEY_PERFORMANCE_DATA = 0x80000004;
|
||||
static const HKEY_PERFORMANCE_TEXT = 0x80000050;
|
||||
static const HKEY_PERFORMANCE_NLSTEXT = 0x80000060;
|
||||
static const KEY_WOW64_32KEY = 0x0200;
|
||||
static const KEY_WOW64_64KEY = 0x0100;
|
||||
{$ifdef linux}
|
||||
class function RegEnumValueA(hKey:pointer;dwIndex:integer;var lpValueName:string;var lpcchValueName:integer;lpReserved:pointer;lpType:pointer;lpData:pointer;lpcbData:pointer):integer;
|
||||
class function RegEnumKeyA(hKey:pointer;dwindex:integer;var lpName:string;ccname:integer):integer;
|
||||
|
|
@ -4822,7 +4824,6 @@ type TRegKey = class
|
|||
@explan(说明) 获得HKEY_CLASSES_ROOT的key %%
|
||||
@return(TRegKey|integer) 如果成功返回 key 对象 %%
|
||||
**}
|
||||
sinit();
|
||||
return new TRegKey(HKEY_CLASSES_ROOT);
|
||||
end
|
||||
class function GetRegKeyUser();
|
||||
|
|
@ -4831,7 +4832,6 @@ type TRegKey = class
|
|||
@explan(说明) 获得HKEY_CURRENT_USER的key %%
|
||||
@return(TRegKey|integer) 如果成功返回 key 对象 %%
|
||||
**}
|
||||
sinit();
|
||||
return new TRegKey(HKEY_CURRENT_USER);
|
||||
end
|
||||
class function GetRegKeyMachine();
|
||||
|
|
@ -4840,7 +4840,6 @@ type TRegKey = class
|
|||
@explan(说明) 获得HKEY_LOCAL_MACHINE的key %%
|
||||
@return(TRegKey|integer) 如果成功返回 key 对象 %%
|
||||
**}
|
||||
sinit();
|
||||
return new TRegKey(HKEY_LOCAL_MACHINE);
|
||||
end
|
||||
class function GetEnviromentKey();
|
||||
|
|
@ -4849,7 +4848,6 @@ type TRegKey = class
|
|||
@explan(说明) 获得环境变量的key %%
|
||||
@return(TRegKey|integer) 如果成功返回 key 对象 %%
|
||||
**}
|
||||
sinit();
|
||||
k1 := new TRegKey(HKEY_LOCAL_MACHINE);
|
||||
return k1.openKeyA("SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment");
|
||||
end
|
||||
|
|
@ -4889,7 +4887,6 @@ type TRegKey = class
|
|||
public
|
||||
function create(h);
|
||||
begin
|
||||
if not HKEY_CLASSES_ROOT then sinit();
|
||||
SetHandle(h);
|
||||
end
|
||||
function Destroy();
|
||||
|
|
@ -4950,8 +4947,8 @@ type TRegKey = class
|
|||
@param(vn)(string) value 名字,nil为默认值%%
|
||||
@param(v)(string) 值 %%
|
||||
**}
|
||||
if not FHandle then return-1;
|
||||
if not(ifstring(vn)or ifnil(vn))then return-1;
|
||||
if not FHandle then return -1;
|
||||
if not(ifstring(vn)or ifnil(vn))then return -1;
|
||||
rs := 0;
|
||||
tp := 1;
|
||||
return RegSetValueExA(FHandle,vn,rs,tp,v,length(v));
|
||||
|
|
@ -4973,8 +4970,8 @@ type TRegKey = class
|
|||
@explan(说明) key %%
|
||||
@param(vn)(string) key %%
|
||||
**}
|
||||
if not FHandle then return-1;
|
||||
if not(ifstring(vn))then return-1;
|
||||
if not FHandle then return -1;
|
||||
if not(ifstring(vn))then return -1;
|
||||
return RegDeleteKeyExA(FHandle,vn,0x0100,0);
|
||||
end
|
||||
function DeleteTreeA(vn);
|
||||
|
|
@ -5047,23 +5044,6 @@ type TRegKey = class
|
|||
end
|
||||
return r;
|
||||
end
|
||||
class function sinit();override;
|
||||
begin
|
||||
{**
|
||||
@explan(˵Ã÷) ³õʼ»¯ %%
|
||||
**}
|
||||
if not HKEY_CLASSES_ROOT then
|
||||
begin
|
||||
HKEY_CLASSES_ROOT := 0x80000000;
|
||||
HKEY_CURRENT_USER := 0x80000001;
|
||||
HKEY_LOCAL_MACHINE := 0x80000002;
|
||||
HKEY_USERS := 0x80000003;
|
||||
HKEY_PERFORMANCE_DATA := 0x80000004;
|
||||
HKEY_PERFORMANCE_TEXT := 0x80000050;
|
||||
HKEY_PERFORMANCE_NLSTEXT := 0x80000060;
|
||||
end
|
||||
inherited;
|
||||
end
|
||||
property Handle read FHandle write SetHandle;
|
||||
{**
|
||||
@param(Handle)(pointer) regkey句柄 %%
|
||||
|
|
|
|||
Loading…
Reference in New Issue