home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Programmer's Library 1.3 / Microsoft-Programers-Library-v1.3.iso / sampcode / win_lrn / metafile / cpmetafi.c < prev    next >
C/C++ Source or Header  |  1988-08-10  |  872b  |  34 lines

  1. /*
  2.  *  CopyMetaFile
  3.  *  This program demonstrates the use of the function CopyMetaFile.
  4.  *  This function copied the source metafile to the file named by second
  5.  *  parameter and returns a handle to the new metafile.
  6.  */
  7.  
  8. #include <windows.h>
  9.  
  10. static HANDLE hWnd;
  11.  
  12. int     PASCAL WinMain (hInstance, hPrevInstance, lpszCmdLine, cmdShow)
  13. HANDLE  hInstance, hPrevInstance;
  14. LPSTR   lpszCmdLine;
  15. int    cmdShow;
  16.   {
  17.   static char    szFuncName[] = "CopyMetaFile";
  18.   HANDLE hMF;
  19.   HANDLE hMF2;
  20.  
  21.   hMF = GetMetaFile ( (LPSTR) "CPMETAFI.MET");
  22.  
  23.   MessageBox (NULL, (LPSTR)"Coping metafile", (LPSTR) szFuncName, MB_OK);
  24.  
  25.   hMF2 = CopyMetaFile (hMF, (LPSTR) "METAFILE");
  26.  
  27.   if (hMF2 != NULL)
  28.     MessageBox (NULL, (LPSTR)"Copied", (LPSTR) szFuncName, MB_OK);
  29.   else
  30.     MessageBox (NULL, (LPSTR)"Not copied", (LPSTR) szFuncName, MB_OK);
  31.  
  32.   return 0;
  33.   }
  34.