|
Programming Video for Windows(1)
Programming Video for Windows by E. J. Bantz http://ej.bantz.com/video/detail/
Jump to a Section Step 1 - Creating the Window Step 2 - Connecting the Window Passing Strings to SendMessage Passing StrUCtures to SendMessage Processing Images from the Video Stream
Step 1 - Creating the Window The video capturing processes starts with the capCreateCaptureWindowA function. When calling this function, a handle to a new window will be returned. The handle is a 32-bit number that is used to reference an object (in this case, a window). This handle is the foundation for the rest of your program, and should be kept it in a safe place.
You can customize the look and feel of this new window by changing the Style parameters. In this example, the window will be a Child and Visible upon creation. lwndC = capCreateCaptureWindowA("My Capture Window", WS_CHILD Or WS_VISIBLE, 0, 0, 160, 120, Me.hwnd, 0)
All future commands are issued by sending a Windows Message to that new window. A Windows Message is sent with the SendMessage function that is built into the Win32 API. You pass this function the Handle of the window you would like to send a command to, the 32-bit message you are sending, a 16-bit parameter, and finally a 32-bit parameter. The 32-bit messages are replaced with an easy to understand constant. I've defined all of the messages that are used for Capturing Video inside VBAVICAP.BAS. Step 2 - Connecting the Window
|