#include once "window9.bi"

#ifdef UNICODE
	Sub CopyDir(ByRef SourseDir As USTRING, ByRef NewDir As USTRING, ByVal flag As Long)  Export
		Dim As USTRING sFrom = SourseDir+WChr(0)
		Dim As USTRING sTo   = NewDir+WChr(0)
		Dim As SHFILEOPSTRUCT op
		ZeroMemory(@op, sizeof(op))
		op.hwnd  = 0
		op.wFunc = FO_COPY
		op.pFrom = *sFrom
		op.pTo   = *sTo
		op.fFlags= flag
		SHFileOperation(Cast(LPSHFILEOPSTRUCT, @op))
	End Sub	
#else	
	Sub CopyDir(ByRef SourseDir As USTRING, ByRef NewDir As USTRING, ByVal flag As Long)  Export
		Dim As String*3000 sFrom = SourseDir+Chr(0)
		Dim As String*3000  sTo   = NewDir+Chr(0)
		Dim As SHFILEOPSTRUCT op
		ZeroMemory(@op, sizeof(op))
		op.hwnd  = 0
		op.wFunc = FO_COPY
		op.pFrom = Cast(LPCSTR,@sFrom)
		op.pTo   = Cast(LPCSTR,@sTo)
		op.fFlags= flag
		SHFileOperation(Cast(LPSHFILEOPSTRUCT, @op))
	End Sub	
#EndIf


