uses registry;
procedure TKeyReportForm.AutoRun;
var
reg:TRegistry;
keyFilePath:string;
begin
{keyFilePath获取文件详细路径。}
keyFilepath:=extractFilePath(application.ExeName)+extractFileName(application.ExeName);
reg:=tregistry.Create;
reg.RootKey:=HKEY_LOCAL_MACHINE;
Try
reg.OpenKey('SOFTWAREMicrosoftWindowsCurrentVersionRun',True);
reg.WriteString('keyboad',KeyFilepath);
except
exit;
End;
reg.CloseKey;
reg.Free;
end;
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/729024/viewspace-564888/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/729024/viewspace-564888/