Frequently Asked Questions

How can i add/remove Context Menu items?

You can add items to Context Menu by inserting the following code using wodFtpDLX ContextMenu Property and MenuClick Event:
Private Const MF_BYCOMMAND = &H0&
Private Const MF_STRING = &H0&
Private Declare Function InsertMenu Lib "user32" Alias "InsertMenuA" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long, ByVal wIDNewItem As Long, ByVal lpNewItem As Any) As Long
Private Declare Function GetSubMenu Lib "user32" (ByVal hMenu As Long, ByVal nPos As Long) As Long
Private Declare Function SetMenu Lib "user32" (ByVal HWND As Long, ByVal hMenu As Long) As Long

Private Sub Form_Load()
If wodFtpDLX1.ContextMenu Then
   InsertMenu GetSubMenu(wodFtpDLX1.ContextMenu, 0), 33701, MF_BYCOMMAND + MF_STRING, 33701, "Test1" 'This is for background menu
   InsertMenu GetSubMenu(wodFtpDLX1.ContextMenu, 1), 33702, MF_BYCOMMAND + MF_STRING, 33702, "Test2" 'This is for file menu
   InsertMenu GetSubMenu(wodFtpDLX1.ContextMenu, 2), 33703, MF_BYCOMMAND + MF_STRING, 33703, "Test3" 'This is for folder menu
End If
wodFtpDLX1.Connect
End Sub

Private Sub wodFtpDLX1_MenuClick(ByVal ID As Long)
If ID = "33701" Then
    MsgBox "Test1"
End If
If ID = "33702" Then
    MsgBox "Test2"
End If
If ID = "33703" Then
    MsgBox "Test3"
End If
End Sub



To delete menu items from Context Menu insert following code:

Private Declare Function DeleteMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long

Private Sub Form_Load()
If wodFtpDLX1.ContextMenu Then
    DeleteMenu wodFtpDLX1.ContextMenu, 32790, 32790 'This disables file "Copy" option
    DeleteMenu wodFtpDLX1.ContextMenu, 32797, 32797 'This disables folder "Copy" option
End If
wodFtpDLX1.Connect
End Sub


 Last updated Fri, Nov 8 2013 12:00am

Please Wait!

Please wait... it will take a second!