Capture video avec AVICAP32.dll
Bonjour,
Je debute sous Delphi et j'essai de porter un programme ecrit en C sous FreeBSD dessus.
Voici le source:
Code:
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
|
unit Video;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFormulaire = class(TForm)
Bouton: TButton;
Log: TMemo;
procedure BoutonClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Formulaire: TFormulaire;
fenetre : tHandle;
fDevice: integer;
DeviceName: array[0..80] of Char;
DeviceVersion: array[0..100] of Char;
Resultat : Boolean;
fCaptureDriverName: string;
implementation
function capCreateCaptureWindow ( lpszWindowName : PChar; dwStyle : DWord; x, y : Integer; nWidth, nHeight : Integer; hwndParent : THandle; nID : Integer ) : THandle; stdcall; external 'AVICAP32.dll';
function capGetDriverDescription ( wDriverIndex : DWord; lpszName : PChar; cbName : Integer; lpszVer : PChar; cbVer : Integer ) : Boolean; stdcall; external 'AVICAP32.dll';
{$R *.dfm}
procedure TFormulaire.BoutonClick(Sender: TObject);
var
fenetre: hwnd;
begin
fenetre := capCreateCaptureWindow(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);
end;
end. |
La ligne qui me pose probleme est:
fenetre := capCreateCaptureWindow(PChar(''), WS_CHILD or WS_VISIBLE or WS_DISABLED, 0, 0, 320, 200, Handle, 0);
end;
Quand je la met, au lieu de lancer ma Form classique, Delphi me renvoi sur Projet_Video dont voici le source
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
|
program Projet_Video;
uses
Forms,
Video in 'Video.pas' {Formulaire};
{$R *.res}
begin
Application.Initialize;
Application.CreateForm(TFormulaire, Formulaire);
Application.Run;
end. |
Avec une fleche sur le begin
D'ou vient le probleme ?
Merci par avance de vos reponses !