#include once "window9.bi"

Sub RenameDir(ByRef SourseDirName As USTRING, ByRef NewDirName As USTRING, ByVal flag As Integer) Export
	Dim As SHFILEOPSTRUCT op
	ZeroMemory(@op, sizeof(SHFILEOPSTRUCT))
	op.hwnd  = 0
	op.wFunc = FO_RENAME
	op.fFlags= flag	
	#ifdef UNICODE
	Dim As WSTRING*3000  sFrom = SourseDirName + WChr(0)
	Dim As WSTRING*3000  sTo   = NewDirName + WChr(0)	
	op.pFrom = @sFrom
	op.pTo   = @sTo	
	#else	
	Dim As USTRING*3000 sFrom = SourseDirName + Chr(0)
	Dim As USTRING*3000  sTo   = NewDirName + Chr(0)	
	op.pFrom = Cast(LPSTR,@sFrom)
	op.pTo   = Cast(LPSTR,@sTo)		
	#EndIf
	SHFileOperation( @op)
End Sub
