BExplorer.Shell.ShellContextMenu.RemoveDefaultExplorerItems C# (CSharp) Method

RemoveDefaultExplorerItems() private method

private RemoveDefaultExplorerItems ( ContextMenu mnu, Control control, MENUITEMINFO &itemInfo ) : void
mnu System.Windows.Forms.ContextMenu
control System.Windows.Forms.Control
itemInfo MENUITEMINFO
return void
    private void RemoveDefaultExplorerItems(ContextMenu mnu, Control control, ref MENUITEMINFO itemInfo) {
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
      if (!(control as ShellView).CurrentFolder.IsDrive && (control as ShellView).CurrentFolder.IsFileSystem && !(control as ShellView).CurrentFolder.IsNetworkPath && !(control as ShellView).CurrentFolder.ParsingName.StartsWith(@"\\")) {
        User32.GetMenuItemInfo(mnu.Handle, 1, true, ref itemInfo);
        if ((itemInfo.fType & 2048) != 0) {
          User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
        } else {
          if (User32.GetMenuItemID(mnu.Handle, 1) - m_CmdFirst == 1) {
            User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
            User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
          }
        }
      }
      if ((control as ShellView).CurrentFolder.IsNetworkPath) {
        User32.GetMenuItemInfo(mnu.Handle, 1, true, ref itemInfo);
        if ((itemInfo.fType & 2048) != 0) {
          User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
          User32.DeleteMenu(mnu.Handle, 0, MF.MF_BYPOSITION);
        }
      }
    }
    private void GenerateSubmenu(ContextMenu child, ContextMenu parent, String header) {