unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, MPlayer, ExtCtrls, ToolWin, ActnMan, ActnCtrls,
ActnMenus, Menus, jpeg, inifiles;
type
TForm2 =
class(TForm)
Button1: TButton;
MediaPlayer1: TMediaPlayer;
Panel1: TPanel;
MainMenu1: TMainMenu;
Datei1: TMenuItem;
Schliessen1: TMenuItem;
Image1: TImage;
Zurck1: TMenuItem;
Optionen1: TMenuItem;
Hintergrundbildndern1: TMenuItem;
Edit1: TEdit;
Movie1: TMenuItem;
Whlen1: TMenuItem;
BritneyonHawaii1: TMenuItem;
StarwarsOuttakes1: TMenuItem;
N11: TMenuItem;
ndern1: TMenuItem;
procedure Button1Click(Sender: TObject);
procedure Schliessen1Click(Sender: TObject);
procedure Zurck1Click(Sender: TObject);
procedure BritneyonHawaii1Click(Sender: TObject);
procedure StarwarsOuttakes1Click(Sender: TObject);
procedure N11Click(Sender: TObject);
procedure ndern1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
ini: TIniFile;
Pass,Moviez,Bild :
String;
implementation
uses Unit1;
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
begin
begin
//Öffnen einer INI-Datei, existiert sie nicht, wird sie neu erzeugt
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+ '
File1.ini');
//ini.WriteString('Form','Pass','Hans');
//Werte auslesen (s. Beispiel oben)
//die Parameter: Abschnittsname, Wertname, Standardrückgabewert,
//falls nicht vorhanden
try
Pass:=ini.ReadString('
Form','
Pass','
Horst');
Moviez:=ini.ReadString('
Movies','
Moviez','
D:\Moviez\starwars.mpeg');
finally
ini.free;
end;
if Edit1.Text = Pass
then
begin
MediaPlayer1.FileName := Moviez;
MediaPlayer1.open;
MediaPlayer1.Display:=panel1;
MediaPlayer1.DisplayRect:=Panel1.ClientRect;
MediaPlayer1.Play;
end
else showmessage ('
IRRE???? OHNE Pass meine Moviez gucken? Fick dich !!!!')
end;
end;
procedure TForm2.Schliessen1Click(Sender: TObject);
begin
close;
end;
procedure TForm2.Zurck1Click(Sender: TObject);
begin
form2.Hide; form1.Show;
end;
procedure TForm2.BritneyonHawaii1Click(Sender: TObject);
begin
begin
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+ '
File1.ini');
try
ini.WriteString('
Movies','
Moviez','
D:\Moviez\Britney.Spears.en.Hawaii.avi');
finally
ini.free;
end;
end;
end;
procedure TForm2.StarwarsOuttakes1Click(Sender: TObject);
begin
begin
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+ '
File1.ini');
try
ini.WriteString('
Movies','
Moviez','
D:\Moviez\starwars.mpeg');
finally
ini.free;
end;
end;
end;
procedure TForm2.N11Click(Sender: TObject);
begin
begin
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+ '
File1.ini');
try
ini.WriteString('
Backs','
BG','
D:/a.jpg');
finally
ini.free;
end;
end;
end;
procedure TForm2.ndern1Click(Sender: TObject);
begin
begin
ini:=TIniFile.create(ExtractFilePath(ParamStr(0))+ '
File1.ini');
try
Bild:=ini.ReadString('
Backs','
BG','
D:/b.jpg')
finally
ini.free;
end;
//Image1.Picture := Bild;
end;
end;
end.