質問

I am trying to create an VB app that can install android apk from PC. In this way, when I want to install apk ,I prefer dropping an apk from explorer to app. But I don't know how to do this . I am new to VB6. Please help me !

役に立ちましたか?

解決

To capture the filenames of the files being dropped on a form you can use the following code:

Private Sub Form_OLEDragDrop(Data As DataObject, Effect As Long, Button As Integer, Shift As Integer, X As Single, Y As Single)
  Dim intFile As Integer
  With Data
    For intFile = 1 To .Files.Count
      Print Data.Files.Item(intFile)
    Next intFile
  End With 'Data
End Sub

This will print the filenames of the files on the form. Just change the Print statement to your own code to install the apk

[EDIT]

I forgot to mention that you have to set the OLEDropMode of the form to 1 - Manual otherwise you can't drop anything on the form

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top