Contents 

ScrRecX Video Recorder
Quick Start
Visual Basic Example
Visual C# Example
Visual C++ Example
Objects
FMScrRec
Properties
Alignment
AudioBufferSize
AudioCodecCount
AudioCodecData
AudioCodecName
AudioDeviceCount
AudioDeviceName
AudioInputName
AudioStreamAsMaster
AudioSync
AudioVolume
Bottom
BytesPerSample
CaptureLayeredWindows
Channels
FlashingBorder
FollowMouse
FramesPerSecond
HighlightColor
HighlightCursor
HighlightRadius
HighlightThickness
KeyFrameInterval
Left
RecordAudio
RecordCursor
Right
SamplesPerSecond
Top
VersionString
VideoCodecCount
VideoCodecData
VideoCodecName
VideoFile
VideoFormat
VideoScale
WindowHandle
WMCustomProfile
WMQuality
Methods
ConfigureAudioCodec
ConfigureVideoCodec
EnumAudioDevices
FreeAudioDevices
FreeCodecs
GetAudioCodecIndexByName
GetAudioCodecNameByIndex
GetAudioDeviceIndexByName
GetAudioDeviceNameByIndex
GetAudioInputCount
GetAudioInputNameByIndex
GetElapsedTime
GetRealFPS
GetVideoCodecIndexByName
GetVideoCodecNameByIndex
LoadCodecs
Pause
SelectRectangle
SelectWindow
SetTraceLevel
Start
Stop
Events
EncodingComplete
EncodingError
EncodingProgress
RecordingComplete
RecordingError
Advanced Topics
How to use the unregistered ScrRecX
FM Screen Capture codec
License
Sales FAQ
Contact

ScrRecX online help

Prev Page Next Page

How to use the unregistered ScrRecX

Usually you need to register an ActiveX component before using it, by using this command: regsvr32 ScrRecX.dll

Sometimes, however you want to use the unregistered ActiveX (for example, in the portable version of your application).

Visual C++ Example

HRESULT CreateComObject(HMODULE hLib, REFCLSID rclsid, REFIID riid, LPVOID* ppv)
{
  PDLLGETCLASSOBJECT pGCO = (PDLLGETCLASSOBJECT)::GetProcAddress(hLib, "DllGetClassObject");
    if( pGCO == NULL )
        return E_POINTER;

  CComPtr<IClassFactory> pFactory;
    HRESULT hr = pGCO(rclsid, IID_IClassFactory, (void**)&pFactory);
  if ( FAILED(hr) )
    return hr;

  hr = pFactory->CreateInstance(NULL, riid, ppv);
  if ( FAILED(hr) )
    return hr;

  return S_OK;
}

...

#import "ScrRecX.dll" no_namespace named_guids raw_interfaces_only

...

CComPtr< IFMScrRec >  pRec;

hLib = LoadLibrary(_T("ScrRecX.dll"));
if ( !hLib )
{
  // Process error
}

HRESULT hr = CreateComObject(hLib, CLSID_FMScrRec, IID_IFMScrRec, (void**)pRec);
if ( FAILED(hr) )
{
  // Process error
}

...

Events

If you use the unregistered ScrRecX object, events never fire. In this case you need to set a windos handle WindowHandle property to receive windows messages instead of events:

VideoRecorder.put_WindowHandle((OLE_HANDLE)HandleToLong(hWnd));

In this case a specified window will receive the following messages:

#define WM_RECORDING_COMPLETE  (WM_APP + 300)
#define WM_RECORDING_ERROR     (WM_APP + 310)
#define WM_ENCODING_COMPLETE   (WM_APP + 320)
#define WM_ENCODING_ERROR      (WM_APP + 330)
#define WM_ENCODING_PROGRESS   (WM_APP + 340)

See Also:

RecordingComplete event
RecordingError event
EncodingComplete event
EncodingError event
EncodingProgress event

   
Converted from CHM to HTML with chm2web Standard 2.76 (unicode)