LScreenCapture::CaptureFromEXEDlg

Summary

Displays a dialog and captures an image from a resource stored in an EXE or DLL into the associated class object's bitmap.

Syntax

#include "ltwrappr.h"

virtual L_INT LScreenCapture::CaptureFromEXEDlg(pszFileName, pTransparentColor, nResType, uFlags, nDialogType=LTCAPDLG_TREEVIEW)

Parameters

L_TCHAR * pszFileName

Character string containing the name of the exe (or dll) from which the resource should be captured.

COLORREF * pTransparentColor

Pointer to a color to be used in place of the transparent color of an Icon or Cursor.

L_INT nResType

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

L_UINT uFlags

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.

L_INT nDialogType

Type of dialog to be displayed. Possible values are:

Value Meaning
CAP_DLG_TREEVIEW Display tree dialog
CAP_DLG_TABVIEW Display tab view

Returns

Value Meaning
SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.

Required DLLs and Libraries

Platforms

Win32, x64.

See Also

Functions

Topics

Example

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 Version 22.0.2023.2.2
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

LEADTOOLS Raster Imaging C++ Class Library Help
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.