home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS - Coast to Coast / simteldosarchivecoasttocoast2.iso / wpj_mag / wpjv1n8.zip / GASH.ZIP / METAFILE / MET1.C next >
Text File  |  1993-08-14  |  737b  |  33 lines

  1. /*
  2.  
  3. MET1.C - Function to load a metafile resource
  4.          (C) 1993, Dennis CHUAH
  5.  
  6. */
  7.  
  8. #define STRICT
  9. #include <windows.h>
  10. #include <windowsx.h>
  11. #include <metafile.h>
  12.  
  13.  
  14. HMETAFILE WINAPI LoadMetafile (HINSTANCE hInstance, LPCSTR lpMetafileName)
  15.   {HGLOBAL handle;
  16.    HMETAFILE hMetafile;
  17.  
  18.    handle = LoadResource (hInstance,
  19.       FindResource (hInstance, lpMetafileName, MAKEINTRESOURCE (METAFILE)));
  20.    if (handle == NULL) return NULL;
  21.    if (LockResource (handle) == NULL)
  22.      {FreeResource (handle);
  23.       return NULL;
  24.      }
  25.  
  26.    hMetafile = (HMETAFILE) SetMetafileBitsBetter ((HMETAFILE) handle);
  27.    UnlockResource (handle);
  28.    FreeResource (handle);
  29.  
  30.    return hMetafile;
  31.   } // end LoadMetafile
  32.  
  33.