"Jens" <til@infojens.dk> wrote in message
news:3b92e6ca$0$260$edfadb0f@dspool01.news.tele.dk...
> Jeg vil da gerne se din version !
>
>
Se'følig da
Det er _ikke_ mig der har skrevet koden; den er fundet på PSC
(
www.planetsourcecode.com), men jeg har pillet lidt ved
den (fjernet kommentarer og sårn):
-------------------------------------
Const MAX_PATH = 260
Public Enum SystemFolder
Desktop = 0
StartMenu_Programs = 2
My_Documents = 5
Favorites = 6
Startup = 7
Recent = 8
SentTo = 9
Start_Menu = 11
Windows_Desktop = 16
Network_Neighborhood = 19
Fonts = 20
ShellNew = 21
AllUsers_Desktop = 25
ApplicationData = 26
Printhood = 27
TemporaryInternetFiles = 32
Cookies = 33
History = 34
End Enum
Private Declare Function SHGetSpecialFolderLocation Lib "shell32" (ByVal
hwnd As Long, ByVal nFolder As Long, Pidl As Long) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" (Pidl As Long,
ByVal FolderPath As String) As Long
Private Function FindSystemFolder(ByVal lngNum As SystemFolder) As String
On Error GoTo FindSystemFolder_Err
Dim lpStartupPath As String * MAX_PATH
Dim Pidl As Long
Dim hResult As Long
hResult = SHGetSpecialFolderLocation(0, lngNum, Pidl)
If hResult = 0 Then
hResult = SHGetPathFromIDList(ByVal Pidl, lpStartupPath)
If hResult = 1 Then
lpStartupPath = Left$(Trim$(lpStartupPath), InStr(lpStartupPath,
Chr(0)) - 1)
FindSystemFolder = Trim$(lpStartupPath)
End If
End If
FindSystemFolder_Err:
Exit Function
End Function
-------------------------------------
Brugen af koden burde være åbenlyst ..
Mvh, Thomas Daugaard