利用Delphi编写Windows控制面板组件及实例
Ex(HKEY_CURRENT_CONFIG,
本文链接地址:http://www.oyaya.net/fanwen/view/141723.html
'Software\Microsoft\windows\CurrentVersion\',
0, KEY_ALL_ACCESS, KeyHandle);
ValSize := SizeOf(Option1);
RegQueryValueEx(KeyHandle,'WinA', nil, nil, @Option1,
@ValSize);
ValSize := SizeOf(Option2);
RegQueryValueEx(KeyHandle,'WinB', nil, nil, @Option2,
@ValSize);
with Form1 do begin
case Option1 of
0: RadioGroup1.ItemIndex:=0;
1: Radiogroup1.ItemIndex:=1;
2: Radiogroup1.ItemIndex:=2;
3: Radiogroup1.ItemIndex:=3;
end;
case Option2 of
0: Radiogroup2.ItemIndex:=0;
1: Radiogroup2.ItemIndex:=1;
2: Radiogroup2.ItemIndex:=2;
3: Radiogroup2.ItemIndex:=3;
end;
end;
end;
- TForm1.CancelClick代码://关闭Form1,返回控制面板
procedure TForm1.CancelClick(Sender: TObject);
begin
close;
end;
- TForm1.ApplyClick代码://设置注册表键值
procedure TForm1.ApplyClick(Sender: TObject);
begin
with Form1 do begin
Option1:=Radiogroup1.ItemIndex;
Option2:=Radiogroup2.ItemInd
《利用Delphi编写Windows控制面板组件及实例(第3页)》