#include once "window9.bi"

function GetSpecialFolder(ByVal folderFlag As integer) As USTRING Export
	Dim pAddress As  LPITEMIDLIST	
	SHGetSpecialFolderLocation(0, folderFlag, @pAddress)
	#ifdef UNICODE
		Dim sRet As USTRING = WSPACE(512)
		SHGetPathFromIDList(pAddress, cast(any ptr , *sRet))
	#else	
		Dim sRet As USTRING*512
		SHGetPathFromIDList(pAddress, Cast(LPSTR,@sRet))
	#EndIf	
	Return sRet
End Function
