EnableExplicit

Procedure.i WEMF_Copy(hMeta.i)
  Define.i xResult
  Define *Mem
  Define.i xSize

  If hMeta
    xSize = GetEnhMetaFileBits_(hMeta, 0, 0)
    If xSize
      *Mem = AllocateMemory(xSize)
      If *Mem
        If GetEnhMetaFileBits_(hMeta, xSize, *Mem)
          xResult = SetEnhMetaFileBits_(xSize, *Mem)
          EndIf
        FreeMemory(*Mem)
        EndIf
      EndIf
    EndIf
  ProcedureReturn xResult
  EndProcedure

; IDE Options = PureBasic 5.31 (Windows - x64)
; CursorPosition = 2
; EnableUnicode
; EnableThread
; EnableXP
; CompileSourceDirectory