Displays a dialog and captures an image from a resource stored in an EXE or DLL into the associated class object's bitmap.
#include "ltwrappr.h"
virtual L_INT LScreenCapture::CaptureFromEXEDlg(pszFileName, pTransparentColor, nResType, uFlags, nDialogType=LTCAPDLG_TREEVIEW)
Character string containing the name of the exe (or dll) from which the resource should be captured.
Pointer to a color to be used in place of the transparent color of an Icon or Cursor.
Type of resource to be captured. Possible values are:
Value | Meaning |
---|---|
RESTYPE_BITMAP | capture a bitmap |
RESTYPE_ICON | capture an icon |
RESTYPE_CURSOR | capture a cursor |
Flags that determine the options dialog. Possible values are:
Value | Meaning |
---|---|
NONE | [0x0000] No "?" help button will be shown. |
SCRDLG_CAPTUREFROMEXE_CONTEXTHELP | [0x0008] Capture from exe options dialog context help. |
Type of dialog to be displayed. Possible values are:
Value | Meaning |
---|---|
CAP_DLG_TREEVIEW | Display tree dialog |
CAP_DLG_TABVIEW | Display tab view |
Value | Meaning |
---|---|
SUCCESS | The function was successful. |
< 1 | An error occurred. Refer to Return Codes. |
Win32, x64.
L_INT LScreenCapture__CaptureFromEXEDlgExample(HWND hWnd)
{
L_INT nRet;
HDC hDC;
RECT rcDestRect;
COLORREF Transparent;
LBitmap LeadBitmap;
LScreenCapture screenCapture(&LeadBitmap);
// CaptureFromExeDlg
//MFCDEM32 is shipped with LEADTOOLS, you have to copy it to the directory of the sample
// it has an ICON with ID=128
nRet = screenCapture.CaptureFromEXEDlg(TEXT("MFCDEM32.EXE"), &Transparent, 0, RESTYPE_BITMAP);
if(nRet == SUCCESS)
{
hDC = GetDC(hWnd);
LeadBitmap.Paint()->SetDC(hDC);
SetRect(&rcDestRect, 0, 0, LeadBitmap.GetWidth(), LeadBitmap.GetHeight());
nRet = LeadBitmap.SetDstRect(&rcDestRect);
if(nRet != SUCCESS)
return nRet;
nRet = LeadBitmap.Paint()->PaintDC();
if(nRet != SUCCESS)
return nRet;
ReleaseDC(hWnd, hDC);
}
else
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