Ignore:
Timestamp:
May 21, 2007, 1:03:21 AM (18 years ago)
Author:
イグトランス (egtra)
Message:

Prompt.sbp内を名前空間に入れた。EnvironmentのMachineName, UserName, GetFolderPathを実装。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Include/basic/function.sbp

    r257 r258  
    12311231End Function
    12321232
     1233Namespace ActiveBasic
     1234    Namespace Windows
     1235        Function GetPathFromIDList(pidl As LPITEMIDLIST) As String
     1236            Dim buf[ELM(MAX_PATH)] As TCHAR
     1237            If SHGetPathFromIDList(pidl, buf) Then
     1238                Return New String(buf)
     1239            Else
     1240                Return ""
     1241            End If
     1242        End Function
     1243
     1244        Function GetFolderPath(hwnd As HWND, folder As Long) As String
     1245            Dim pidl As LPITEMIDLIST
     1246            Dim hr = SHGetSpecialFolderLocation(hwnd, folder, pidl)
     1247            If SUCCEEDED(hr) Then
     1248                GetFolderPath = GetPathFromIDList(pidl)
     1249                CoTaskMemFree(pidl)
     1250            Else
     1251                GetFolderPath = ""
     1252            End If
     1253        End Function
     1254
     1255        Function GetFolderPath(folder As Long) As String
     1256            Return GetFolderPath(0, folder)
     1257        End Function
     1258    End Namespace
     1259End Namespace
     1260
    12331261#endif '_INC_FUNCTION
Note: See TracChangeset for help on using the changeset viewer.