#Include once "window9.bi"

Function CopyDir(ByVal SourseDir As String,ByVal NewDir As String,ByVal flag As Integer) As Integer Export
  Dim As String*3000 From_ = SourseDir+Chr(0)
  Dim As String*3000  To_   = NewDir+Chr(0)
  Dim As SHFILEOPSTRUCT op
  ZeroMemory(@op, sizeof(op))
  op.hwnd  = 0
  op.wFunc = FO_COPY
  op.pFrom = Cast(LPCSTR,@From_)
  op.pTo   = Cast(LPCSTR,@To_)
  op.fFlags= flag
  Return SHFileOperation(Cast(LPSHFILEOPSTRUCT, @op))
End Function

