From 6b0f01b3522f710ef3a2b1c2a974faa90ade0fa8 Mon Sep 17 00:00:00 2001 From: tslediter Date: Tue, 14 Nov 2023 17:13:39 +0800 Subject: [PATCH] Update tslvcl.tsf MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit windows 注册表常量 --- funcext/tvclib/tslvcl.tsf | 46 +++++++++++---------------------------- 1 file changed, 13 insertions(+), 33 deletions(-) diff --git a/funcext/tvclib/tslvcl.tsf b/funcext/tvclib/tslvcl.tsf index 0a28b59..5f534ae 100644 --- a/funcext/tvclib/tslvcl.tsf +++ b/funcext/tvclib/tslvcl.tsf @@ -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_ROOTkey %% @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_USERkey %% @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_MACHINEkey %% @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 %%