// IDocHostUIHandler Implementation public int ShowContextMenu(uint dwID, ref tagPOINT ppt, [MarshalAs(UnmanagedType.IUnknown)] object pcmdtReserved, [MarshalAs(UnmanagedType.IDispatch)] object pdispReserved) { if (container.IsContextMenuEnabled) { if (container.ContextMenu != null) { //show the assigned ContextMenu System.Drawing.Point pt = new System.Drawing.Point(ppt.x, ppt.y); pt = container.PointToClient(pt); container.ContextMenu.Show(container, pt); return(HRESULT.S_OK); } else { //show the default IE ContextMenu return(HRESULT.S_FALSE); } } else { return(HRESULT.S_OK); } }