PMVolga
Дата: 05.01.2012 19:43:28
Объявляем функцию:
'Функция определения пути к рабочему столу
Public Const CSIDL_DESKTOPDIRECTORY = 16
Public Declare Function SHGetFolderPath Lib "shfolder" Alias "SHGetFolderPathA" _
(ByVal hwndOwner As Long, ByVal nFolder As Long, ByVal hToken As Long, ByVal dwFlags As Long, _
ByVal pszPath As String) As Long
Использование:
Dim strDesktopPath As String
strDesktopPath = String(260, 0)
Call SHGetFolderPath(0, CSIDL_DESKTOPDIRECTORY, 0, 0, strDesktopPath)
strDesktopPath = Left(strDesktopPath, InStr(1, strDesktopPath, Chr(0)) - 1)