タイトルのまんま…スタートアップフォルダのパス名を取得するサンプルです。
'--------------------------------------------------------
' Form
'--------------------------------------------------------
Private Sub Form_Load()
Dim lngIdList As Long
Dim strStartUpPath As String * 80
Call SHGetSpecialFolderLocation(Me.hwnd, CSIDL_STARTUP, lngIdList)
Call SHGetPathFromIDList(lngIdList, strStartUpPath)
MsgBox strStartUpPath
End Sub
'--------------------------------------------------------
' Module
'--------------------------------------------------------
Public Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwnd As Long, ByVal nFolder As Integer, ppidl As Long) As Long
Public Declare Function SHGetPathFromIDList Lib "shell32.dll" (ByVal ppidl As Long, ByVal pszPath As String) As Boolean
Public Const CSIDL_STARTUP = &H7
DownLoad vbtips112.lzh 2KB (VB6.0)