光盘的自动运行

  • 主题发起人 主题发起人 import
  • 开始时间 开始时间
I

import

Unregistered / Unconfirmed
GUEST, unregistred user!
设置光盘的自动运行特征: procedure TForm1.SetCDAutoRun(AAutoRun:Boolean);
const
DoAutoRun : array[Boolean] of Integer = (0,1);
var
Reg : TRegistry;
begin
try
{ create our registry object }
Reg := TRegistry.Create;
{ set our registry root key }
Reg.RootKey := HKEY_LOCAL_MACHINE;
{ verify that our CDROM class key exists }
if Reg.KeyExists('System') then
{ try to open our CDROM class key }
if Reg.OpenKey('System',FALSE) then
{ add AutoRun to our CDROM class key }
Reg.WriteBinaryData('AutoRun',DoAutoRun[AAutoRun],1);
finally
{ free our registry object }
Reg.Free;
end;
{ showmessage that the changes will happen on reboot }
ShowMessage('Your settings will take effect on the next reboot of Windows.');
end;
 
后退
顶部