This will be a well-known method name to those of my readers who ever dealt with context menu shell-extensions. Since I am at the moment resuming the work on my own multi-purpose shell-extension, I also searched for resources and there appears to be a strange misconception on how this method should be used.
Here the prototype:
HRESULT IContextMenu::QueryContextMenu(
HMENU hmenu,
UINT indexMenu,
UINT idCmdFirst,
UINT idCmdLast,
UINT uFlags
);