|
Last change
on this file since 284 was 269, checked in by イグトランス (egtra), 18 years ago |
|
basicディレクトリの一部の_System関数をActiveBasic名前空間へ入れた
|
|
File size:
738 bytes
|
| Line | |
|---|
| 1 | 'Classes/ActiveBasic/Windows/Windows.ab
|
|---|
| 2 |
|
|---|
| 3 | Namespace ActiveBasic
|
|---|
| 4 | Namespace Windows
|
|---|
| 5 |
|
|---|
| 6 | Function GetPathFromIDList(pidl As LPITEMIDLIST) As String
|
|---|
| 7 | Dim buf[ELM(MAX_PATH)] As TCHAR
|
|---|
| 8 | If SHGetPathFromIDList(pidl, buf) Then
|
|---|
| 9 | Return New String(buf)
|
|---|
| 10 | Else
|
|---|
| 11 | Return ""
|
|---|
| 12 | End If
|
|---|
| 13 | End Function
|
|---|
| 14 |
|
|---|
| 15 | Function GetFolderPath(hwnd As HWND, folder As Long) As String
|
|---|
| 16 | Dim pidl As LPITEMIDLIST
|
|---|
| 17 | Dim hr = SHGetSpecialFolderLocation(hwnd, folder, pidl)
|
|---|
| 18 | If SUCCEEDED(hr) Then
|
|---|
| 19 | GetFolderPath = GetPathFromIDList(pidl)
|
|---|
| 20 | CoTaskMemFree(pidl)
|
|---|
| 21 | Else
|
|---|
| 22 | GetFolderPath = ""
|
|---|
| 23 | End If
|
|---|
| 24 | End Function
|
|---|
| 25 |
|
|---|
| 26 | Function GetFolderPath(folder As Long) As String
|
|---|
| 27 | Return GetFolderPath(0, folder)
|
|---|
| 28 | End Function
|
|---|
| 29 |
|
|---|
| 30 | End Namespace 'Widnows
|
|---|
| 31 | End Namespace 'ActiveBasic
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.