用KOL操作注册表(非DELPHI的registry)
2013-02-16 13:38
330 查看
{ KOL MCK } // Do not remove this line! {$DEFINE KOL_MCK} unit main; interface {$IFDEF KOL_MCK} uses Windows, Messages, ShellAPI, KOL {$IFNDEF KOL_MCK}, mirror, Classes, Controls, mckControls, mckObjs, Graphics, mckCtrls {$ENDIF (place your units here->)}, KolExRegistry{哎!真不容易,三天才找到该单元应该放在这里,其实人家明明写着。}; {$ELSE} {$I uses.inc} Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs; {$ENDIF} type {$IFDEF KOL_MCK} {$I MCKfakeClasses.inc} {$IFDEF KOLCLASSES} TForm1 = class; PForm1 = TForm1; {$ELSE OBJECTS} PForm1 = ^TForm1; {$ENDIF CLASSES/OBJECTS} {$IFDEF KOLCLASSES}{$I TForm1.inc}{$ELSE} TForm1 = object(TObj) {$ENDIF} Form: PControl;Reg:PExRegistry;{放在这里} {$ELSE not_KOL_MCK} TForm1 = class(TForm) {$ENDIF KOL_MCK} KOLProject1: TKOLProject; KOLForm1: TKOLForm; Button1: TKOLButton; procedure Button1Click(Sender: PObj); private { Private declarations } public { Public declarations } end; var Form1 {$IFDEF KOL_MCK} : PForm1 {$ELSE} : TForm1 {$ENDIF} ; {$IFDEF KOL_MCK} procedure NewForm1( var Result: PForm1; AParent: PControl ); {$ENDIF} implementation {$IFNDEF KOL_MCK} {$R *.DFM} {$ENDIF} {$IFDEF KOL_MCK} {$I main_1.inc} {$ENDIF} function GetCurrentDir: string; begin GetDir(0, Result); end; procedure TForm1.Button1Click(Sender: PObj); begin if assigned(Reg) then reg.free; Reg:=NewExRegistry; Reg.RootKey:=HKEY_LOCAL_MACHINE; Reg.OpenKey('SOFTWARE',true); Reg.CreateKey('KolExRegistry'); Reg.OpenKey('KolExRegistry',true); Reg.WriteString('Path',GetCurrentDir); Reg.CloseKey; //form.Close; end; end.
相关文章推荐
- c# RegistryKey注册表操作
- 技巧:在Delphi中轻松操作注册表轻松操作注册表
- delphi 操作注册表
- delphi注册表操作(读取、添加、删除、修改)
- c# RegistryKey操作注册表
- 在Delphi程序中操作注册表(转)
- Delphi中注册表的操作
- Operating the registry help class(C#读写注册表操作)
- Delphi操作注册表
- delphi 注册表操作(读取、添加、删除、修改)完全手册
- 在Delphi中轻松操作注册表
- 注册表的操作(Registry handling with .NET)
- 在Delphi程序中操作注册表
- delphi注册表操作完全手册
- delphi 注册表操作(读取、添加、删除、修改)完全手册
- delphi 注册表操作(读取、添加、删除、修改)完全手册
- RegistryKey 操作注册表
- Delphi经典实例1------操作Window注册表
- delphi 注册表操作(读取、添加、删除、修改)完全手册
- Delphi操作注册表