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