#define STRICT
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
BOOL APIENTRY DllMain( HINSTANCE hinstDLL, DWORD dwReason, LPVOID lpvReserved )
{
return TRUE;
}
HENHMETAFILE APIENTRY __declspec( dllexport ) Wmf2Emf( LPCTSTR cWMF )
{
HMETAFILE hWMF = GetMetaFile( cWMF );
UINT nSize = GetMetaFileBitsEx( hWMF, 0, NULL );
LPVOID lpvData = HeapAlloc( GetProcessHeap(), 0, nSize );
HENHMETAFILE hEMF;
GetMetaFileBitsEx( hWMF, nSize, lpvData );
hEMF = SetWinMetaFileBits( nSize, lpvData, 0, NULL );
HeapFree( GetProcessHeap(), 0, lpvData );
DeleteMetaFile( hWMF );
return hEMF;
}
/*
HENHMETAFILE APIENTRY __declspec( dllexport ) hWmf2Emf( HDC hDC, HMETAFILE hWMF )
{
UINT nSize = GetMetaFileBitsEx( hWMF, 0, NULL );
LPVOID lpvData = HeapAlloc( GetProcessHeap(), 0, nSize );
HENHMETAFILE hEMF;
GetMetaFileBitsEx( hWMF, nSize, lpvData );
hEMF = SetWinMetaFileBits( nSize, lpvData, hDC, NULL );
HeapFree( GetProcessHeap(), 0, lpvData );
return hEMF;
}
*/
BOOL APIENTRY __declspec( dllexport ) PlayEMF( HDC hDC, HENHMETAFILE hEMF )
{
ENHMETAHEADER emh;
if ( !GetEnhMetaFileHeader( hEMF, sizeof( emh ), &emh ) )
return FALSE;
return PlayEnhMetaFile( hDC, hEMF, ( CONST RECT * ) &emh.rclBounds );
}
/*
BOOL APIENTRY __declspec( dllexport ) PlayEMF2( HDC hDC, HENHMETAFILE hEMF )
{
ENHMETAHEADER emh;
if ( !GetEnhMetaFileHeader( hEMF, sizeof( emh ), &emh ) )
return FALSE;
return PlayEnhMetaFile( hDC, hEMF, ( CONST RECT * ) &emh.rclFrame );
}
*/
BOOL APIENTRY __declspec( dllexport ) DeleteEMF( HENHMETAFILE hEMF )
{
return DeleteEnhMetaFile( hEMF );
}