Screen Record by C++ / C# with Screen Capturing SDK - ByteScout

Screen Record by C++ / C# with Screen Capturing SDK

  • Home
  • /
  • Articles
  • /
  • Screen Record by C++ / C# with Screen Capturing SDK

How to Record Your Screen in C++/C#

As a programmer, do you sometimes wish that there is a faster and easier way to complete various tasks such as seamlessly recording the screen in C# or C++? Screen Capturing SDK can help you in that duty, as well as in many other similar tasks.

Screen record by C++ with Screen Capturing SDK – use the sample source code below. You may also use it from C# and other languages to record screen video.

C++ Source Code Sample

// CaptureFromEntireScreen.cpp : Defines the entry point for the console application.

#include "stdafx.h"
#import "BytescoutScreenCapturing.dll"

using namespace BytescoutScreenCapturingLib;
using namespace std;

void usage(ICapturer* capturer);
void setParams(int argc, _TCHAR* argv[], ICapturer* capturer);

int _tmain(int argc, _TCHAR* argv[])

// Create Capturer instance

CLSID clsid_ScreenCapturer;
CLSIDFromProgID(OLESTR("BytescoutScreenCapturing.Capturer"), &clsid_ScreenCapturer);

ICapturer* capturer = NULL;
::CoCreateInstance(clsid_ScreenCapturer, NULL, CLSCTX_ALL, __uuidof(ICapturer), (LPVOID*)&capturer);

if (!capturer)
 _ftprintf(stdout, _T("Screen Capturer is not installed properly."));
 return 1;


// Set capturing type

// Set output video width and height

// Set output file name
capturer->OutputFileName = _T("Output.wmv");

// Start capturing
HRESULT hr = capturer->Run();

if (FAILED(hr))
 // Error handling
 CComBSTR s;
 _ftprintf(stdout, _T("Capture failed: %sn"), CString(s));
 _tprintf(_T("Starting capture - Hit a key to stop ...n"));

 int i = 0;
 TCHAR *spin = _T("|/-\");

 // Show some progress
 while (!_kbhit())
 	_tprintf(_T("rEncoding %c"), spin[i++]);
 	i %= 4;

 // Stop after key press

// Release Capturer
capturer = NULL;


return 0;

Screen Capturing SDK gives developers of any skill and experience level the flexibility to work in different programming languages and frameworks.

Now, would you like to see Screen Capturing SDK in action? Just copy and paste the code we provided into your C# application and witness how it makes capturing your screen so much easier and time-conserving.

Check the FREE trial version by downloading it from Bytescout’s website. Programming tutorials and pertinent source code samples are also thrown in with your trial version.