我把整段代码贴出来了,繁劳大家看看.
/////////////////////////
unit screen;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, StdCtrls,inifiles;
type
TForm2 = class(TForm)
Panel1: TPanel;
Panel2: TPanel;
Panel3: TPanel;
Panel4: TPanel;
Panel5: TPanel;
Panel6: TPanel;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Image5: TImage;
Image6: TImage;
Image7: TImage;
Shape1: TShape;
Shape2: TShape;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Timer1: TTimer;
Memo2: TMemo;
procedure FormClose(Sender: TObject;
var Action: TCloseAction);
procedure Timer1Timer(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
speed1,timedelay1:integer;
speed2,timedelay2:integer;
speed3,timedelay3:integer;
speed4,timedelay4:integer;
speed5,timedelay5:integer;
speed6,timedelay6:integer;
speed7,timedelay7:integer;
speed8,timedelay8:integer;
file1,file2,file3,file4,file5,file6:string;
settingfont:Tfont;
procedure seting();
implementation
uses word, settingcode;
{$R *.DFM}
procedure seting();
begin
with form2do
begin
shape1.Visible:=false;
shape2.Visible:=false;
shape3.Visible:=false;
shape4.Visible:=false;
shape5.Visible:=false;
shape6.Visible:=false;
end;
end;
procedure TForm2.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
form1.ScrollingCreditsBox1.HaltScroll;
end;
procedure TForm2.Timer1Timer(Sender: TObject);
var _port,_stop,_run,_backrun:integer;
begin
_port:=readport();
_stop:=_port and 16;
_run:=_port and 224;
_backrun:=_port and 8;
if (_backrun<>0) and (_stop<>0) then
_close:=false;
if _close=true then
exit;
case _run of
128:begin
seting();
shape1.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file1);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
192:begin
seting();
shape2.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file2);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
0:begin
seting();
shape3.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file3);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
64:begin
seting();
shape4.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file4);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
160:begin
seting();
shape5.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file5);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
224:begin
seting();
shape6.Visible:=true;
if _stop=0 then
begin
form1.memo1.Lines.LoadFromFile(file6);
timer1.Enabled:=false;
form1.ShowModal;
end;
end;
end;
end;
FUNCTION ReadPort:byte;
begin
ASM
MOV DX, 379h;
IN AL, DX;
MOV @result, AL;
end;
end;
procedure TForm2.FormShow(Sender: TObject);
begin
timer1.Enabled:=true;
end;
procedure TForm2.FormCreate(Sender: TObject);
var wordproini: TIniFile;
begin
settingfont:=tfont.Create;
wordproIni := TIniFile.Create('c:/wordpro.ini');
wordproIni.ReadSectionValues('setting', Memo2.Lines);
speed1:=strtoint(Memo2.Lines.Values['speed1']);
speed2:=strtoint(Memo2.Lines.Values['speed2']);
speed3:=strtoint(Memo2.Lines.Values['speed3']);
speed4:=strtoint(Memo2.Lines.Values['speed4']);
speed5:=strtoint(Memo2.Lines.Values['speed5']);
speed6:=strtoint(Memo2.Lines.Values['speed6']);
speed7:=strtoint(Memo2.Lines.Values['speed7']);
speed8:=strtoint(Memo2.Lines.Values['speed8']);
timedelay1:=strtoint(Memo2.Lines.Values['timedelay1']);
timedelay2:=strtoint(Memo2.Lines.Values['timedelay2']);
timedelay3:=strtoint(Memo2.Lines.Values['timedelay3']);
timedelay4:=strtoint(Memo2.Lines.Values['timedelay4']);
timedelay5:=strtoint(Memo2.Lines.Values['timedelay5']);
timedelay6:=strtoint(Memo2.Lines.Values['timedelay6']);
timedelay7:=strtoint(Memo2.Lines.Values['timedelay7']);
timedelay8:=strtoint(Memo2.Lines.Values['timedelay8']);
file1:=Memo2.Lines.Values['file1'];
file2:=Memo2.Lines.Values['file2'];
file3:=Memo2.Lines.Values['file3'];
file4:=Memo2.Lines.Values['file4'];
file5:=Memo2.Lines.Values['file5'];
file6:=Memo2.Lines.Values['file6'];
settingFont.Name:=Memo2.Lines.Values['fontname'];
settingFont.size:=strtoint(Memo2.Lines.Values['fontsize']);
//settingFont.color:=stringtocolor(Memo2.Lines.Values['fontcolor']);
if Memo2.Lines.Values['fontstyle']='fsbold' then
settingFont.style:=[fsbold];
if Memo2.Lines.Values['fontstyle']='fsItalic' then
settingFont.style:=[fsItalic];
if Memo2.Lines.Values['fontstyle']='fsUnderline' then
settingFont.style:=[fsUnderline];
if Memo2.Lines.Values['fontstyle']='fsStrikeOut' then
settingFont.style:=[fsStrikeOut];
wordproIni.Free;
end;
procedure TForm2.FormKeyDown(Sender: TObject;
var Key: Word;
Shift: TShiftState);
begin
showmessage('111');
end;
end.