TrayIcon2.balloontitle:= ReleaseNo;
Timer1.Interval := 0;
Timer1.Enabled := false;
strWork:=FloatToStrF(int(WkChkDateTime),ffFixed,10,0);
WkZipStartSerial:=(( strtoint(strwork) * 24 * 60 ) - 36819900 )
+ StrToInt(DtEdit1_1[WkChkPoint]) * 60 +
StrToInt(DtEdit1_2[WkChkPoint]);
WkZipEndSerial:= wkZipStartSerial + StrToInt(DtEdit2[WkChkPoint]);
WkZipStartSerial := WkZipStartSerial* 60;
WkZipEndSerial := WkZipEndSerial * 60;
// showmessage(ExtractFileDir(Edit_srec.text) + '\srec.ini' +' ' + inttostr(WkZipStartSerial));
inifile :=Tinifile.Create(ExtractFileDir(Edit_srec.text) + '\srec.ini');
inifile.writeString('RRTadd','RecTempFolder',DtEdit3[WkChkPoint]) ;
inifile.writeString('RRTadd','RecFolder',DtEdit3[WkChkPoint]) ;
if DtEdit4_2[WkchkPoint] = '' then
DtEdit4_2[WkchkPoint]:= '_';
inifile.writeString('RRTadd','RecFilePre',DtEdit4_1[WkChkPoint]
+ FormatDateTime(DtEdit4_2[WkChkPoint],WkchkDateTime)) ;
inifile.writeinteger('RRTadd','TIMER_ENABLE',1) ;
inifile.writeinteger('RRTadd','TM_START',WkZipStartSerial) ;
inifile.writeinteger('RRTadd','TM_END',WkZipEndSerial) ;
inifile.writeinteger('RRTadd','TM_POWERDOWN',0) ;
inifile.free;
Application.ProcessMessages;
// 'edit
{現在のプログラムのスタートアップ情報を取得}
GetStartupInfo(SI);
{他のアプリケーションの起動}
if not CreateProcess(PChar(edit_srec.text), nil, nil, nil, False,
CREATE_DEFAULT_ERROR_MODE, nil, nil, SI,PI) then
{CreateProcess が False を返したときはエラー}
raise Exception.Create('srec を起動できません');
Button1.Enabled := False;
StatusBar1.simpleText := '実行中';
StatusBar1.Show;
Application.ProcessMessages;
// 終了待ち(10秒待つけど、正常終了までLOOP)
repeat
begin
ecode := WaitForSingleObject(PI.hProcess, 10000);
Application.ProcessMessages;
end;
until ecode = WAIT_OBJECT_0;
StatusBar1.simpleText := '';
StatusBar1.Show;
(*
for i := 0 to 1000 do
begin
// ecode := WaitForInputIdle(PI.hProcess, 10000);
ecode := WaitForSingleObject(PI.hProcess, 10000);
if ecode = WAIT_OBJECT_0 then break;
if ecode = WAIT_TIMEOUT then break;
Application.ProcessMessages;
end;
*)
(*
// メッセージ表示
for i := 0 to 1000 do
begin
ecode := WaitForSingleObject(PI.hProcess, 10000);
if ecode = WAIT_OBJECT_0 then break;
if ecode = WAIT_TIMEOUT then break;
Application.ProcessMessages;
end;
*)
(*
appActivate('S Rec');
SendKeys('{TAB}{TAB}',true);
SendKeys('EN050421_{TAB}',true);
for i :=1 to 12 do
begin
SendKeys('{TAB}',true)
end;
SendKeys('2005/4/21{TAB}',false);
SendKeys('14:15:00{TAB}{TAB}{TAB}',false);
SendKeys('15{TAB}',false); //
SendKeys('{ENTER}',false);
ecode := WaitForSingleObject(PI.hProcess,INFINITE);
// ボタンを有効化
*)
jump_end:
Button1.Enabled := True;
Timer1.Interval := GlTimerInterval * 1000;
Timer1.Enabled := True;
end;
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
if radiogroup1.ItemIndex <> 0 then
groupBox1.font.color:= clGradientInactiveCaption
else
groupBox1.font.color:= clWindowText;
// showmessage('radigroup1');
groupBox1.show;
// showmessage('radigroup1');
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
openDialog1.Execute;
edit_srec.Text:= openDialog1.FileName;
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
// application.Minimize;
Form1.Hide;
trayicon2.Visible:=true;
end;
procedure TForm1.RadioGroup2Click(Sender: TObject);
begin
if radiogroup2.ItemIndex <> 0 then
groupBox2.font.color:= clGradientInactiveCaption
else
groupBox2.font.color:= clWindowText;
groupBox2.show;
end;
procedure TForm1.RadioGroup3Click(Sender: TObject);
begin
if radiogroup3.ItemIndex <> 0 then
groupBox3.font.color:= clGradientInactiveCaption
else
groupBox3.font.color:= clWindowText;
groupBox3.show;
end;
procedure TForm1.RadioGroup4Click(Sender: TObject);
begin
if radiogroup4.ItemIndex <> 0 then
groupBox4.font.color:= clGradientInactiveCaption
else
groupBox4.font.color:= clWindowText;
groupBox4.show;
end;
procedure TForm1.RadioGroup5Click(Sender: TObject);
begin
if radiogroup5.ItemIndex <> 0 then
groupBox5.font.color:= clGradientInactiveCaption
else
groupBox5.font.color:= clWindowText;
groupBox5.show;
end;
procedure TForm1.Label4Click(Sender: TObject);
begin
HlinkNavigateString(nil,'http://www.geocities.jp/buriburipipi/');
end;
procedure TForm1.Label5Click(Sender: TObject);
begin
HlinkNavigateString(nil,'http://blog.goo.ne.jp/buriburipipi');
end;
procedure TForm1.FormActivate(Sender: TObject);
begin
if Edit_srec.Text ='右のボタンを押してsrec70.exe を探してください' then
Form1.PageControl1.ActivePageIndex:=1;
end;
procedure TForm1.Block1Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block1Edit3.Text := Dir;
end;
procedure TForm1.Block2Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block2Edit3.Text := Dir;
end;
procedure TForm1.Block3Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block3Edit3.Text := Dir;
end;
procedure TForm1.Block4Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block4Edit3.Text := Dir;
end;
procedure TForm1.Block5Button1Click(Sender: TObject);
begin
if SelectDirectory(Dir, [sdAllowCreate, sdPerformCreate, sdPrompt],0) then
Block5Edit3.Text := Dir;
end;
procedure TForm1.Timer2Timer(Sender: TObject);
begin
// Timer2.Interval := GlTimerInterval * 1000;
Timer2.Enabled := false;
if checkbox2.Checked then
begin
// Application.Minimize;
// Application.
// trayicon2.Visible:=true;
// Form1.Hide;
/// ShowMessage('timmer start');
button3.click;
end;
end;
end.