'Classes/ActiveBasic/Windows/Windows.ab Namespace ActiveBasic Namespace Windows Function GetPathFromIDList(pidl As LPITEMIDLIST) As String Dim buf[ELM(MAX_PATH)] As TCHAR If SHGetPathFromIDList(pidl, buf) Then Return New String(buf) Else Return "" End If End Function Function GetFolderPath(hwnd As HWND, folder As Long) As String Dim pidl As LPITEMIDLIST Dim hr = SHGetSpecialFolderLocation(hwnd, folder, pidl) If SUCCEEDED(hr) Then GetFolderPath = GetPathFromIDList(pidl) CoTaskMemFree(pidl) Else GetFolderPath = "" End If End Function Function GetFolderPath(folder As Long) As String Return GetFolderPath(0, folder) End Function End Namespace 'Widnows End Namespace 'ActiveBasic