event QueryContextMenu (Folder as ExShellFolder, Items as String, Separator as String)
Fired when the context menu is about to be active.

TypeDescription
Folder as ExShellFolder A Folder object whose context menu is displayed
Items as String A string expression that specifies the context menu items to display.
Separator as String A string expression that contains the separator text to use in the Items parameter.

Fires when the context menu is about to display. This allows you to customize the control context menu. You can then react to the context menu through the BeforeShellMenuCommand and AfterShellMenuCommand menus.

Syntax for QueryContextMenu event, /NET version, on:

private void QueryContextMenu(object sender,exontrol.EXFOLDERVIEWLib.ExShellFolder Folder,ref string Items,ref string Separator)
{
}

Private Sub QueryContextMenu(ByVal sender As System.Object,ByVal Folder As exontrol.EXFOLDERVIEWLib.ExShellFolder,ByRef Items As String,ByRef Separator As String) Handles QueryContextMenu
End Sub

Syntax for QueryContextMenu event, /COM version, on:

private void QueryContextMenu(object sender, AxEXFOLDERVIEWLib._IExFolderViewEvents_QueryContextMenuEvent e)
{
}

void OnQueryContextMenu(LPDISPATCH Folder,LPCTSTR FAR* Items,LPCTSTR FAR* Separator)
{
}

void __fastcall QueryContextMenu(TObject *Sender,Exfolderviewlib_tlb::IExShellFolder *Folder,BSTR * Items,BSTR * Separator)
{
}

procedure QueryContextMenu(ASender: TObject; Folder : IExShellFolder;var Items : WideString;var Separator : WideString);
begin
end;

procedure QueryContextMenu(sender: System.Object; e: AxEXFOLDERVIEWLib._IExFolderViewEvents_QueryContextMenuEvent);
begin
end;

begin event QueryContextMenu(oleobject Folder,string Items,string Separator)
end event QueryContextMenu

Private Sub QueryContextMenu(ByVal sender As System.Object, ByVal e As AxEXFOLDERVIEWLib._IExFolderViewEvents_QueryContextMenuEvent) Handles QueryContextMenu
End Sub

Private Sub QueryContextMenu(ByVal Folder As EXFOLDERVIEWLibCtl.IExShellFolder,Items As String,Separator As String)
End Sub

Private Sub QueryContextMenu(ByVal Folder As Object,Items As String,Separator As String)
End Sub

LPARAMETERS Folder,Items,Separator

PROCEDURE OnQueryContextMenu(oExFolderView,Folder,Items,Separator)
RETURN

Syntax for QueryContextMenu event, /COM version (others), on:

<SCRIPT EVENT="QueryContextMenu(Folder,Items,Separator)" LANGUAGE="JScript">
</SCRIPT>

<SCRIPT LANGUAGE="VBScript">
Function QueryContextMenu(Folder,Items,Separator)
End Function
</SCRIPT>

Procedure OnComQueryContextMenu Variant llFolder String llItems String llSeparator
	Forward Send OnComQueryContextMenu llFolder llItems llSeparator
End_Procedure

METHOD OCX_QueryContextMenu(Folder,Items,Separator) CLASS MainDialog
RETURN NIL

void onEvent_QueryContextMenu(COM _Folder,COMVariant /*string*/ _Items,COMVariant /*string*/ _Separator)
{
}

function QueryContextMenu as v (Folder as OLE::Exontrol.FolderView.1::IExShellFolder,Items as C,Separator as C)
end function

function nativeObject_QueryContextMenu(Folder,Items,Separator)
return

The following sample code adds two new menu items to the folder context menu.

Private Sub ExFolderView1_QueryContextMenu(ByVal Folder As EXFOLDERVIEWLibCtl.IExShellFolder, Items As String, Separator As String)
    Items = Separator & "New Item1" & Separator & "New Item2"
End Sub