Re: Replace context menus - WeOnlyDo Discussion board

Re: Replace context menus (General questions)

by wodSupport, Friday, October 29, 2004, 21:45 (7121 days ago) @ Sascha

Change that code a bit :) Here's VB6 code, I'm sure you'll easy convert it to VB.NET:
[code]Private Sub wodFtpDLX1_ShowContextMenu(ByVal Item As wodFtpDLXLibCtl.IDirItem, Menu As Long, HWND As Long)
Dim m As Long

m = GetMenu(Me.HWND)
If Item Is Nothing Then
m = GetSubMenu(m, 0)
Else
If Item.Type = typeDirectory Then
m = GetSubMenu(m, 2)
Else
m = GetSubMenu(m, 1)
End If
End If
Menu = m
HWND = Me.HWND
End Sub
[/code]

basically, before you return menu handle to HWND param, choose appropriate menu (0=background, 1=file, 2=directory) with GetSubMenu API.


Complete thread: