ps:不一定要全解释,能看明白1个模块的就说一个模块的功能就好
程序原代码:
FrmToR
Private Type SHITEMID 'mkid
cb As Long 'Size of the ID (including cb itself)
abID As Byte 'The item ID (variable length)
End Type
Private Type ITEMIDLIST 'idl
mkid As SHITEMID
End Type
Private Declare Function SHGetPathFromIDList Lib "shell32.dll" Alias "SHGetPathFromIDListA" (ByVal pidl As Long, ByVal pszPath As String) As Long
Private Declare Function SHGetSpecialFolderLocation Lib "shell32.dll" (ByVal hwndOwner As Long, ByVal nFolder As Long, pidl As ITEMIDLIST) As Long
Private Const NOERROR = 0
Private Const CSIDL_DESKTOP = &H0
Private Const CSIDL_PROGRAMS = &H2
Private Const CSIDL_CONTROLS = &H3
Private Const CSIDL_PRINTERS = &H4
Private Const CSIDL_PERSONAL = &H5 ' (Documents folder)
Private Const CSIDL_FAVORITES = &H6
Private Const CSIDL_STARTUP = &H7
Private Const CSIDL_RECENT = &H8 ' (Recent folder)
Private Const CSIDL_SENDTO = &H9
Private Const CSIDL_BITBUCKET = &HA
Private Const CSIDL_STARTMENU = &HB
Private Const CSIDL_DESKTOPDIRECTORY = &H10
Private Const CSIDL_DRIVES = &H11
Private Const CSIDL_NETWORK = &H12
Private Const CSIDL_NETHOOD = &H13
Private Const CSIDL_FONTS = &H14
Private Const CSIDL_TEMPLATES = &H15
Private Declare Function SHBrowseForFolder Lib "shell32.dll" Alias "SHBrowseForFolderA" (lpBrowseInfo As BROWSEINFO) As Long 'ITEMIDLIST
Private Type BROWSEINFO 'bi
hOwner As Long
pidlRoot As Long
pszDisplayName As String
lpszTitle As String
ulFlags As Long
lpfn As Long
lParam As Long
iImage As Long
End Type
Private Const BIF_RETURNONLYFSDIRS = &H1
Private Const BIF_DONTGOBELOWDOMAIN = &H2
Private Const BIF_STATUSTEXT = &H4
Private Const BIF_RETURNFSANCESTORS = &H8
Private Const BIF_BROWSEFORCOMPUTER = &H1000
Private Const BIF_BROWSEFORPRINTER = &H2000
Private Sub CmdStart_Click()
Dim sha As ClsDrawLine
Set sha = New ClsDrawLine
For i = 1 To Me.FileSH.ListCount
Next i
End Sub
Private Sub Command1_Click()
Dim bi As BROWSEINFO
Dim idl As ITEMIDLIST
Dim rtn&, pidl&, path$, pos%
bi.hOwner = Me.hwnd
bi.lpszTitle = "Browsing is set to: "
bi.ulFlags = BIF_RETURNONLYFSDIRS
pidl& = SHBrowseForFolder(bi)
path$ = Space$(512)
rtn& = SHGetPathFromIDList(ByVal pidl&, ByVal path$)
If rtn& Then
pos% = InStr(path$, Chr$(0))
Label3.caption = Left(path$, pos - 1)
FileSH.path = Label3.caption + "\data\shase\" + Me.Combo1.Text
FileSZ.path = Label3.caption + "\data\sznse\" + Me.Combo1.Text
End If
End Sub
Private Sub FileSH_Click()
End Sub
Private Sub FileSZ_Click()
End Sub
Private Sub Form_Load()
With Me.Combo1
.AddItem "Day"
.AddItem "Week"
.AddItem "Month"
.ListIndex = 0
End With
End Sub
Private Sub Label1_Click()
End Sub
Private Sub Label1_LinkError(LinkErr As Integer)
End Sub
[此贴子已经被作者于2006-5-29 13:31:40编辑过]