Signals that the user has pressed the capture HotKey.
#include "ltwrappr.h"
virtual L_INT LScreenCapture::CaptureHotKeyCallBack(nHotKey, uHotKeyModifiers)
Key code for activation key.
Modifier keys used with nHotKey. Possible values are listed below and may be combined using the bitwise OR ( | ) operator.
| Value | Meaning |
|---|---|
| MOD_ALT | Alt Key pressed. |
| MOD_CONTROL | Control key pressed. |
| MOD_SHIFT | Shift key pressed. |
| 0 | No modifier key was pressed. |
| Value | Meaning |
|---|---|
| SUCCESS | The function was successful. |
| < 1 | An error occurred. Refer to Return Codes. |
You can override this function to do initialization processing before the capture operation starts.
Win32, x64.
// ScreenCapture Callbacksclass LUserScreenCapture : public LScreenCapture{HWND m_hWnd;public:LUserScreenCapture(HWND hWnd){m_hWnd = hWnd;}virtual ~LUserScreenCapture(){};virtual L_INT CaptureHotKeyCallBack(L_INT nHotKey,L_UINT uHotKeyModifiers);virtual L_INT ScreenCaptureCallBack();};// This callback will be called once the hotkey is pressedL_INT LUserScreenCapture::CaptureHotKeyCallBack(L_INT nHotKey,L_UINT uHotKeyModifiers){UNREFERENCED_PARAMETER(nHotKey);UNREFERENCED_PARAMETER(uHotKeyModifiers);MessageBox(m_hWnd, TEXT("HotKey pressed."), TEXT("CaptureHotKeyCallBack"), MB_OK);return SUCCESS;}// This callback will be called once an image is capturedL_INT LUserScreenCapture::ScreenCaptureCallBack(){RECT rcClientRect;HDC hDC;hDC = GetDC(m_hWnd);// get the client rect of the windowGetClientRect(m_hWnd, &rcClientRect);// paint the captured imagem_pBitmap->Paint()->SetDC(hDC);m_pBitmap->SetDstRect(&rcClientRect);m_pBitmap->Paint()->PaintDC();ReleaseDC(m_hWnd, hDC);return SUCCESS;}L_INT LScreenCapture__CaptureHotKeyCallBackExample(HWND hWnd){L_INT nRet;LBitmapBase LeadBitmap;LUserScreenCapture screenCapture(hWnd);LEADCAPTUREOPTION CaptureOptions;screenCapture.SetBitmap(&LeadBitmap);// get original capture optionsnRet = screenCapture.GetCaptureOptions(&CaptureOptions);if(nRet == SUCCESS){// Set capture count to 2CaptureOptions.uCount = 2;nRet = screenCapture.SetCaptureOptions(&CaptureOptions);if(nRet != SUCCESS)return nRet;}elsereturn nRet;// EnableCallBack should be called in order for the callbacks to be activatedscreenCapture.EnableCallBack(TRUE);// CaptureActiveWindow - HotKey = F11// After calling this function above callbacks will be callednRet = screenCapture.CaptureActiveWindow();if(nRet != SUCCESS)return nRet;return SUCCESS;}
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document
