unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls;
type
TForm1 =
class(TForm)
Panel1: TPanel;
procedure FormCreate(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
const
WM_CAP_DRIVER_CONNECT = WM_USER + 10;
WM_CAP_EDIT_COPY = WM_USER + 30;
WM_CAP_SET_PREVIEW = WM_USER + 50;
WM_CAP_SET_OVERLAY = WM_USER + 51;
WM_CAP_SET_PREVIEWRATE = WM_USER + 52;
implementation
{$R *.dfm}
function capCreateCaptureWindow(lpszWindowName: LPCSTR;
dwStyle: DWORD;
x, y,
nWidth,
nHeight: integer;
hwndParent: HWND;
nID: integer): HWND;
stdcall;
external '
AVICAP32.DLL'
name '
capCreateCaptureWindowA';
procedure TForm1.Formcreate;
var handle:THandle;
begin
handle := capCreateCaptureWindow('
Video',ws_child+ws_visible, 0,
0, 320, 240, Panel1.Handle, 1);
SendMessage(
handle, WM_CAP_DRIVER_CONNECT, 0, 0);
SendMessage(
handle, WM_CAP_SET_PREVIEWRATE, 30, 0);
sendMessage(
handle, WM_CAP_SET_OVERLAY, 1, 0);
SendMessage(
handle, wm_cap_set_preview, 1, 0);
end;
end.
//orig von [url]http://www.delphipraxis.net/post282535.html#282535[/url]