1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
| unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, StdCtrls, jpeg, MPlayer;
type
TForm1 = class(TForm)
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Button1: TButton;
StaticText1: TStaticText;
Image2: TImage;
Button2: TButton;
Image3: TImage;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
Form1: TForm1;
myHandle : integer;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
begin
StaticText1.caption := 'c est bon' ;
Image2.Visible := true ;
Image3.Visible := False ;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
StaticText1.caption := 'Jeu non lancé ' ;
Image2.Visible := False ;
Image3.Visible := True ;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
myHandle := FindWindow(nil, 'Far Cry 2');
if myHandle > 0 then
ShowMessage('Jeu FarCry2 lancé')
else
ShowMessage('Jeu FarCry2 non trouvé');
end;
end. |
Partager