[API]
GetVersion

[INCLUDE]
AppBase
GetSpecialFolderPath
CreateDirectoryEx

[CODE]
Public Function ProfileDirectoryBase_Filenames(ByVal AppDirSubPath As String, ByVal AppDirSubPathShort As String) As String
  Dim xLong1 As Long
  Dim xChar1 As String

  ProfileDirectoryBase_Filenames = AppBase(Chr(1))
  'GoTo UseAppData
  xLong1 = GetVersion
  If (GetVersion And &H80000000) = 0& And (xLong1 And &HFF&) > 5& Then
'UseAppData:
    xChar1 = Trim(GetSpecialFolderPath(26&, True))
    If Not Len(xChar1) = 0& Then
      If CreateDirectoryEx(xChar1 & AppDirSubPath) Then
        ProfileDirectoryBase_Filenames = xChar1 & AppDirSubPath + "\"
        ElseIf CreateDirectoryEx(xChar1 & AppDirSubPathShort) Then
        ProfileDirectoryBase_Filenames = xChar1 & AppDirSubPathShort + "\"
        End If
      End If
    End If
  End Function
