Hello
I have some code about shell extension, it works well, but when i choose
more than a txt files and right-click, click open, system popup a dialog
"InvokeCommand", system can not open the txt files, i do not know what
reason.
************************************************** **************************
***************
' Carries out the command associated with
' a context menu item.
'
Private Sub IContextMenu_InvokeCommand(lpici As shlext.CMINVOKECOMMANDINFO)
Dim Idx As Long, Verb As String
On Error Resume Next
' Check if lpVerb is an string pointer
' or the ID
If (lpici.lpVerb \ &H10000) <> 0 Then
' lpVerb is a string so
' copy it from the pointer
Verb = StrFromPtrA(lpici.lpVerb)
' Search the items array for
' the command and convert
' it to the item index
For Idx = 0 To UBound(m_Items)
If m_Items(Idx).Verb = Verb Then
Exit For
End If
Next
Else
Idx = lpici.lpVerb
' Do the action asociated
' with the menu item
Dim fileNames As String
Select Case Idx
Case 0
For Idx = 0 To UBound(m_SelectedFiles)
If fileNames = "" Then
fileNames = m_SelectedFiles(Idx)
Else
fileNames = fileNames & "," & m_SelectedFiles(Idx)
End If
Next
Call Shell(App.Path & "\application1.exe /" & fileNames,
vbNormalFocus)
Case 1
For Idx = 0 To UBound(m_SelectedFiles)
If fileNames = "" Then
fileNames = m_SelectedFiles(Idx)
Else
fileNames = fileNames & "," & m_SelectedFiles(Idx)
End If
Next
Call Shell(App.Path & "\application2.exe /" & fileNames,
vbNormalFocus)
End Select
End If
End Sub
************************************************** **************************
*******
Thanks