unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ComCtrls, jpeg, ExtCtrls, MPlayer, StdCtrls, Mask;
type
TPForm =
class(TForm)
PMain: TImage;
Laden1: TAnimate;
Laden2: TAnimate;
PasswortInfo: TLabel;
PW2: TMaskEdit;
PW1: TMaskEdit;
PWOK: TButton;
User: TLabel;
Starttext: TLabel;
RCode1: TEdit;
RCode2: TEdit;
RCode3: TEdit;
RCodeOk: TButton;
Soundbar: TMediaPlayer;
sys: TTimer;
DatumTimer: TTimer;
procedure sysTimer(Sender: TObject);
procedure DatumTimerTimer(Sender: TObject);
procedure UserClick(Sender: TObject);
procedure PWOKClick(Sender: TObject);
procedure RCodeOkClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure PMainMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure UserMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
PForm: TPForm;
Zeile,Spalte,Lange,Cursor:Integer;
PList:TStringList;
Datzeit:
String;
implementation
{$R *.DFM}
procedure TPForm.sysTimer(Sender: TObject);
begin
if Laden1.Visible=TRUE
then
begin
Laden1.Hide;
Laden2.Hide;
PMain.Picture:=nil;
PForm.Cursor:=crDefault;
Starttext.Show;
User.show;
end;
end;
procedure TPForm.DatumTimerTimer(Sender: TObject);
begin
Datzeit:=TimeToStr(Time)+'
'+DateToStr(Date);
end;
procedure TPForm.UserClick(Sender: TObject);
begin
// Main Part: Login -----------------------------------------------------------
// PMain.Picture:=res.UserBG.Picture;
PForm.Color:=clwhite;
User.Hide;
// Überprüfung von Daten und Beschädigungen-----------------------------------
if Copy(PList[0],1,10)='
0123456789'
then
begin
PList.Append('
Cofiguring...');
PList.Append('
Setting...');
PList.Append('
');
end
else
begin
// Wenn Abfrage falsch dann...
halt;
end;
if Copy(PList[3],1,19)<>'
[REGISTERED]=[TRUE]'
then
begin
Starttext.Caption:='
Bitte geben Sie den Registriercode ein:';
RCode1.Show;
RCode2.Show;
RCode3.Show;
RCodeOk.show;
end
else
begin
Starttext.hide;
RCode1.Hide;
RCode2.Hide;
RCode3.Hide;
RCodeOk.Hide;
end;
// Beenden von Überprüfung -------------------------------------------------
end;
procedure TPForm.PWOKClick(Sender: TObject);
begin
if (PW1.Text=PW2.Text)
and (
not (PW1.Text='
'))
then
begin
PW1.Hide;
PW2.Hide;
PasswortInfo.Hide;
PList.Delete(4);
PList.Append(PW1.Text);
PList.SaveToFile('
Pegasus.txt');
if FileExists('
Pegasus.dll')
then
DeleteFile('
Pegasus.dll');
RenameFile('
Pegasus.txt','
Pegasus.dll');
PList.Free;
end;
end;
procedure TPForm.RCodeOkClick(Sender: TObject);
begin
if (RCode1.Text='
1201')
and (RCode2.Text='
1996')
and (RCode3.Text='
1705')
then
begin
// Registrierung vollzeihen -------------------------------------------------
PList.Delete(3);
PList.Append('
[REGISTERED]=[TRUE]');
// Passwortauswahlfeld sichtbar machen --------------------------------------
PW1.Show;
PW2.show;
PasswortInfo.Show;
PWOK.Show;
// Registrierung ausschalten ------------------------------------------------
Starttext.hide;
RCode1.Hide;
RCode2.Hide;
RCode3.Hide;
RCodeOk.Hide;
end
else
begin
with Soundbar
do
begin
FileName:='
Error.wav';
Open;
EndPos:=TrackLength[2]
div 2;
Play;
PList.Append('
ERROR: '+Datzeit);
end;
end;
end;
procedure TPForm.FormCreate(Sender: TObject);
const
crTest1=1;
// aus externer .CUR-Datei
begin
// Überprüfen von Dateivohandenkeit bzw erstellen ------------------------
PList.Create;
if FileExists('
Pegasus.txt')
then
PList.LoadFromFile('
Pegasus.txt');
PList.Append('
0123456789');
// Erstellprozedur beenden -----------------------------------------------
Cursor:=0;
Screen.Cursors[crTest1]:=LoadCursorFromFile(PChar('
none.cur'));
Cursor:=crTest1;
Laden1.Cursor:=crTest1;
Laden2.Cursor:=crTest1;
end;
procedure TPForm.PMainMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
User.Font.Color:=clsilver;
User.Font.Style:=[fsBold,fsUnderline];
end;
procedure TPForm.UserMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
User.Font.Color:=clwhite;
User.Font.Style:=[fsBold];
end;
end.