Arsip: shutdown otomatis

 
user image
more 13 years ago

galfa

para master delphi mohon bantuannya saya punya script kayak gini tolong dikoreksi da yang salah dmnnya y? setiap run pada start up selalu muncul pesan box "failed set data for project" terimakasih procedure RunOnStartup(sProgtitle,sCmdline:string); var reg:TRegIniFile; begin reg:=TRegIniFile.Create(''); reg.RootKey:=HKEY_LOCAL_MACHINE; reg.WriteString('Software\Microsoft'+'\Windows\CurrentVersion\Run',sProgtitle,sCmdline); reg.Free; end; procedure TForm1.Timer1Timer(Sender: TObject); var s:String; begin AlphaBlend:=True; AlphaBlendValue:=10; s:=TimeToStr(Time); label1.Caption:=TimeToStr(Time); end; procedure TForm1.FormCreate(Sender: TObject); begin RunOnStartup('HAHAHA','"E:\data galfa\Latihan Delphi\reeboot\Project2.exe"'); end; procedure TForm1.FormActivate(Sender: TObject); var s:string; begin s:=TimeToStr(Time); if (s[1]='1') and (s[2]='0') then begin AlphaBlend:=False; AlphaBlendValue:=255; Timer1.Enabled:=False; WinExec('shutdown -s -t 05 -f',SW_NORMAL); end else Timer1.Enabled:=True; end;
user image
more 13 years ago

n3o_cybertech

mo nulis data di registry???pake TRegistry aj biar langsung..ato dari code itu kalo ga salah sebelum WriteString itu kita perlu OpenKey terlebih dahulu :)
user image
more 13 years ago

galfa

maaf kk n3o_cybertech mksdnya gmn? aku kurang faham!! hehehe maklum masih newbie!! bisa ditulisin dikit ja!!
user image
more 13 years ago

LuriDarmawan

@galfa tolong penulisannya jangan kebanyakan [u:992bb07dfb]tanda seru[/u:992bb07dfb]. enggak sedang marah2 khan? .
user image
more 13 years ago

aday-gate

maksud kk neo begini gan
procedure RunOnStartup(sProgtitle:string);
var
reg:TRegistry;
begin
reg:=TRegIniFile.Create();
Try
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',true)
reg.WriteString(sProgtitle);
reg.CloseKey;
Finally
reg.Free;
end; 
atau coba codenya tetap tp diubah dikit jadi :
procedure RunOnStartup(sProgtitle,sCmdline:string);
var
reg:TRegIniFile;
begin
reg:=TRegIniFile.Create('');
try
reg.RootKey:=HKEY_LOCAL_MACHINE;
reg.OpenKey('\Software\Microsoft\Windows\CurrentVersion\Run',true);
reg.WriteString(sProgtitle,sCmdline);
reg.closekey;
finally
reg.Free;
end;  
user image
more 13 years ago

galfa

kk @luridarmawan maaf y hehe.. oke akan aku coba dulu y trimakasih...
user image
more 13 years ago

asiyrob

membuat reg key di startup windows?? untuk mengaktifkan aplikasi shutdown?? buat apaaan?? [afwan om ulil kebanyakan tanda tanya "??"]
more ...
  • Pages:
  • 1
Share to
Local Business Directory, Search Engine Submission & SEO Tools FreeWebSubmission.com SonicRun.com