#Include once "window9.bi"

Function DeleteDir(ByVal DeleteDirName As String,ByVal flag As Integer) As Integer Export
  Dim As String*3000 From_ = DeleteDirName+Chr(0)
  Dim As SHFILEOPSTRUCT op
  ZeroMemory(@op, sizeof(op))
  op.hwnd  = 0
  op.wFunc = FO_DELETE
  op.pFrom = Cast(LPCSTR,@From_)
  op.pTo   = 0
  op.fFlags= flag
  Return SHFileOperation( @op)
End Function
