Page 1 of 1

Listar bmps de uma dlls

Posted: Thu Aug 09, 2007 12:13 pm
by kbelo
Pessoal é possivel fazer uma lista dos Bmp de uma dll?´
se possivel posso imprimir esses bmps tambem?

Posted: Thu Aug 09, 2007 1:31 pm
by Antonio Linares
Marcelo,

Te refieres a hacerlo en tiempo de ejecución, desde tu aplicación ?

Posted: Thu Aug 09, 2007 2:00 pm
by kbelo
Sim em tempo de execução.

Posted: Thu Aug 09, 2007 5:24 pm
by RenOmaS
Voce pode experimentar :

Code: Select all

........
aBitMaps := EnumResourcesBitMap()
................



#pragma BEGINDUMP

#include <WinTen.h>
#include <windows.h>
#include <CommDlg.h>
#include <ClipApi.h>

static far int nResourceIndex = 0;
static far BOOL bGetName = FALSE;

static int CALLBACK EnumResourceFunc( HANDLE hModule, // resource-module handle
                                      LPCTSTR lpszType,  // pointer to resource type
                                      LPTSTR lpszName,   // pointer to resource name
                                      LONG lParam  // application-defined parameter
                                      )
{
  #ifdef __XPP__
     void * params = _params;
  #endif

  ++nResourceIndex;
  if ( bGetName )
     _storc( lpszName, -1, nResourceIndex );
  return 1;
}

HB_FUNC( ENUMRESOURCESBITMAP )
{
  ENUMRESNAMEPROC  lpEnumResourceFunc = ( ENUMRESNAMEPROC  )
      MakeProcInstance( ( FARPROC ) EnumResourceFunc, GetInstance() );

  // Get the number of recurs bitmap
  nResourceIndex = 0;
  bGetName = FALSE;
  EnumResourceNames( NULL, RT_BITMAP, lpEnumResourceFunc, NULL );

  // Get the recurso bitmap names
  _reta( nResourceIndex );
  nResourceIndex = 0;
  bGetName = TRUE;
  EnumResourceNames( NULL, RT_BITMAP, lpEnumResourceFunc, NULL );

  FreeProcInstance( ( FARPROC ) EnumResourceFunc );
}

#pragma ENDDUMP