#include once "window9.bi"

#ifdef UNICODE
	Sub DeleteDir(ByRef DeleteDirName As USTRING, ByVal flag As Integer)  Export
		Dim As USTRING sFrom = DeleteDirName+wChr(0)
		Dim As SHFILEOPSTRUCT op
		ZeroMemory(@op, sizeof(op))
		op.hwnd  = 0
		op.wFunc = FO_DELETE
		op.pFrom = *sFrom
		op.pTo   = 0
		op.fFlags= flag
		SHFileOperation( @op)
	End Sub	
#else	
	Sub DeleteDir(ByRef DeleteDirName As String, ByVal flag As Integer)  Export
		Dim As String*3000 sFrom = DeleteDirName+Chr(0)
		Dim As SHFILEOPSTRUCT op
		ZeroMemory(@op, sizeof(op))
		op.hwnd  = 0
		op.wFunc = FO_DELETE
		op.pFrom = Cast(LPCSTR,strptr(sFrom))
		op.pTo   = 0
		op.fFlags= flag
		SHFileOperation( @op)
	End Sub	
#EndIf

