Does your computer have a webcam? See others use QQ to play video screen you will not think how to achieve? Here, the use of Delphi using Ms AVICAP32.DLL can easily realize the camera programming, if coupled with your network programming level, to achieve a video chat is not a problem.
Look at the code in the following code:
Const Wm_cap_start = wm_user;
Const WM_CAP_STOP = Wm_cap_start + 68;
Const WM_CAP_DRIVER_CONNECT = Wm_cap_start + 10;
Const WM_CAP_DRIVER_DISCONNECT = Wm_cap_start + 11;
Const WM_CAP_SAVEDIB = Wm_cap_start + 25;
Const WM_CAP_GRAB_FRAME = Wm_cap_start + 60;
Const Wm_cap_sequence = Wm_cap_start + 62;
Const WM_CAP_FILE_SET_CAPTURE_FILEA = Wm_cap_start + 20;
Const Wm_cap_sequence_nofile =wm_cap_start+
Const wm_cap_set_overlay =wm_cap_start+ '
Const wm_cap_set_ PREVIEW =wm_cap_start+
Const Wm_cap_set_callback_videostream = Wm_cap_start +6;
Const Wm_cap_set_callback_error=wm_cap_start +2;
Const wm_cap_set_callback_statusa= Wm_cap_start +3;
Const wm_cap_set_callback_frame= Wm_cap_start +5;
Const wm_cap_set_scale=wm_cap_start+
Const wm_cap_set_previewrate=wm_cap_start+
function Capcreatecapturewindowa (Lpszwindowname:pchar; dwstyle:longint; x:integer;
Y:integer;nwidth:integer;nheight:integer; Parentwin:hwnd;
Nid:integer): HWND; StdCall EXTERNAL ' AVICAP32. DLL ';
The code above is the definition of a function and a constant that we use primarily.
Well, open your Delphi, create a new project, and add the above definition.