Option ExplicitPrivate Declare Function SHAddToRecentDocs Lib "shell32.dll" (ByVal dwFlags As Long, ByVal dwData As String) As LongPublic Sub AddRecent(strFile As String)
Dim lRetVal As Long
If strFile = "" Then
lRetVal = SHAddToRecentDocs(SHARD_PATH, vbNullString)
Else
lRetVal = SHAddToRecentDocs(SHARD_PATH, strFile)
End If
End SubPrivate Sub cmdAdd_Click()
If (txtFile.Text <> "") Then AddRecent (txtFile.Text)
End SubPrivate Sub cmdBrowse_Click()
dlgFile.ShowOpen
txtFile.Text = dlgFile.FileName
End SubPrivate Sub cmdExit_Click()
Unload Me
End SubPrivate Sub txtFile_Change()
If (txtFile.Text <> "") Then
cmdAdd.Enabled = True
Else
cmdAdd.Enabled = False
End If
End Sub
==============================================运行的结果是SHARD_PATH变量没有定义我不知道应该定义SHARD_PATH为多少const SHARD_PATH=?查MSDN没有查到,哪个高人指点一下?
Dim lRetVal As Long
If strFile = "" Then
lRetVal = SHAddToRecentDocs(SHARD_PATH, vbNullString)
Else
lRetVal = SHAddToRecentDocs(SHARD_PATH, strFile)
End If
End SubPrivate Sub cmdAdd_Click()
If (txtFile.Text <> "") Then AddRecent (txtFile.Text)
End SubPrivate Sub cmdBrowse_Click()
dlgFile.ShowOpen
txtFile.Text = dlgFile.FileName
End SubPrivate Sub cmdExit_Click()
Unload Me
End SubPrivate Sub txtFile_Change()
If (txtFile.Text <> "") Then
cmdAdd.Enabled = True
Else
cmdAdd.Enabled = False
End If
End Sub
==============================================运行的结果是SHARD_PATH变量没有定义我不知道应该定义SHARD_PATH为多少const SHARD_PATH=?查MSDN没有查到,哪个高人指点一下?
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货