MOD EDIT: We do NOT support keylogging or spy applications or other malicious activity, even if it *IS* open source.

WOW! Why is that? It is really open source with new FreeBSD license. This can help other people write their code! I wrote it just for fun and learning some winapi of video capture. You see there are people who need this.

The "people who NEED this" are the fucking scumbag script kiddies and organized crime douchenozzles that make software like this required. Don't be fucking daft.

Instead of copying the include and library files, I modified the "Additional Include Directories" and "Additional Library Directories" to also have the original directories where the Win SDK files are found. That also works.

Good tutorial!
Hi, a note for future, when newlines are added to paragraphs they can look jagged on other displays.

Attempt to reproduce :

This WebCam Tutorial will guide you through connecting a webcam in Microsoft Windows and grabbing a frame from the camera so we can later
save it to a bitmap file called "Frame.bmp".
First of all this is a c++ win32 Tutorial so create an empty Win32 application.

Could you let me know what needs to be done if i need to use your code to capture multiple images?

Also, one problem that I am facing with this code is, not everytime when I run the code, the video will be displayed on start camera option. It shows a blank black screen at times. But sometimes, it works fine. Any specific reason for this problem? I am using code blocks.

Could you let me know what needs to be done if i need to use your code to capture multiple images?

Also, one problem that I am facing with this code is, not everytime when I run the code, the video will be displayed on start camera option. It shows a blank black screen at times. But sometimes, it works fine. Any specific reason for this problem? I am using code blocks.

Its an old api and under Win 7 has some problems it was originally developed for XP on PC's
I am working on a new webcam program that uses the latest api you will have to wait until I
expose this tutorial.

However I have found that while the program has problems running from the IDE under Win7 it has no
problems under release that is build it as an .exe and run it from there.

Could you let me know what needs to be done if i need to use your code to capture multiple images?

Also, one problem that I am facing with this code is, not everytime when I run the code, the video will be displayed on start camera option. It shows a blank black screen at times. But sometimes, it works fine. Any specific reason for this problem? I am using code blocks.

Its an old api and under Win 7 has some problems it was originally developed for XP on PC's
I am working on a new webcam program that uses the latest api you will have to wait until I
expose this tutorial.

However I have found that while the program has problems running from the IDE under Win7 it has no
problems under release that is build it as an .exe and run it from there.

Snoopy.

Thank you for ur response. I will try with .exe. and do u have any thoughts on how I could use this to capture multiple images ( 3 or 4).

Hi Snoopy,
Thanks a lot for all the help. I'm able to preview the 2 consecutive captured bitmap images using the code. But as you can see in the code below (bold part), when I use WM_CAP_FILE_SAVEDIB for two different images, only the latest image gets saved in both. I'm trying to solve this problem but could not find any solution. Could you please help me on how I can save both the bitmaps which are in the "curFrame" and "lasFrame" HBITMAP objects?

Thanks for the reply and it did help me out. Although, when I made changes to work with WM_CAP_FILE_SAVEDIB directly instead of writing CreateBitmapInfoStruct & CreateBMPFile functions, I am facing problems in saving the file. I have made the specific changes correctly (I think ) But when i use WM_CAP_FILE_SAVEDIB, same image is being captured in both Frame1 and Frame2. Am I missing something?