- some fixes and speed up more folder content loading
61bead7a
Dimitar Tsenev
committed
4 changed files
Extensions.cs
/Shell/Extensions.cs
/Shell/Extensions.cs
ShellContextMenu.cs
/Shell/ShellContextMenu.cs-7+12
/Shell/ShellContextMenu.cs
Add comment 424 submenuHandle == IntPtr.Zero ? menu.Handle : submenuHandle, TPM.TPM_RETURNCMD, pos.X, pos.Y, m_MessageWindow.Handle, IntPtr.Zero
Add comment 425 );
Add comment 426
Add comment 427 Minus   if (command > 0) InvokeCommand((IntPtr)(command - m_CmdFirst), pos, (IntPtr)(command - m_CmdFirst));
Add comment 427 Plus   if (command > 0)
Add comment 428 Plus   InvokeCommand((IntPtr)(command - m_CmdFirst), pos, (IntPtr)(command - m_CmdFirst));
Add comment 428 429 }
Add comment 429 430
Add comment 430 431 return User32.GetMenuItemCount(submenuHandle == IntPtr.Zero ? menu.Handle : submenuHandle);
Add comment 580 581 IListItemEx parent = null;
Add comment 581 582
Add comment 582 583 for (int n = 0; n < items.Length; ++n) {
Add comment 583 Minus   pidls[n] = Shell32.ILFindLastID(items[n].PIDL);
Add comment 584 Plus   pidls[n] = items[n].ILPidl;
Add comment 584 585
Add comment 585 586 if (parent == null) {
Add comment 586 587 if (items[n].ParsingName.Equals(ShellItem.Desktop.ParsingName)) {
Add comment 587 588 parent = FileSystemListItem.ToFileSystemItem(IntPtr.Zero, ShellItem.Desktop.Pidl);
Add comment 588 589 } else {
Add comment 589 Minus   parent = FileSystemListItem.ToFileSystemItem(IntPtr.Zero, items[n].PIDL).Parent;
Add comment 590 Plus   parent = items[n].Parent;
Add comment 590 591 }
Add comment 591 592 } else if (!items[n].Parent.Equals(parent)) {
Add comment 592 593 throw new Exception("All shell items must have the same parent");
Add comment 616 617 var ishellViewPtr = (item.IsDrive || !item.IsFileSystem || item.IsNetworkPath) ? item.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID) : item.Parent.GetIShellFolder().CreateViewObject(IntPtr.Zero, typeof(IShellView).GUID);
Add comment 617 618 var view = Marshal.GetObjectForIUnknown(ishellViewPtr) as IShellView;
Add comment 618 619 view?.GetItemObject(SVGIO.SVGIO_BACKGROUND, typeof(IContextMenu).GUID, out _Result);
Add comment 619 Minus   if (view != null) Marshal.ReleaseComObject(view);
Add comment 620 Plus   if (view != null)
Add comment 621 Plus   Marshal.ReleaseComObject(view);
Add comment 620 622 m_ComInterface = (IContextMenu)Marshal.GetTypedObjectForIUnknown(_Result, typeof(IContextMenu));
Add comment 621 623 m_ComInterface2 = m_ComInterface as IContextMenu2;
Add comment 622 624 m_ComInterface3 = m_ComInterface as IContextMenu3;
Add comment 627 629 try {
Add comment 628 630 var hhh = IntPtr.Zero;
Add comment 629 631 iShellExtInit?.Initialize(_ShellView.CurrentFolder.PIDL, null, 0);
Add comment 630 Minus   if (iShellExtInit != null) Marshal.ReleaseComObject(iShellExtInit);
Add comment 632 Plus   if (iShellExtInit != null)
Add comment 633 Plus   Marshal.ReleaseComObject(iShellExtInit);
Add comment 631 634 Marshal.Release(iShellExtInitPtr);
Add comment 632 635 } catch {
Add comment 633 636
Add comment 681 684 if (itemInfo.hSubMenu == IntPtr.Zero) {
Add comment 682 685 // If the item has no submenu we can't get the tag, so
Add comment 683 686 // check its ID to determine if it was added by the shell.
Add comment 684 Minus   if (itemInfo.wID >= m_CmdFirst) remove.Add(n);
Add comment 687 Plus   if (itemInfo.wID >= m_CmdFirst)
Add comment 688 Plus   remove.Add(n);
Add comment 685 689 } else {
Add comment 686 690 User32.GetMenuInfo(itemInfo.hSubMenu, ref menuInfo);
Add comment 687 Minus   if (menuInfo.dwMenuData != tag) remove.Add(n);
Add comment 691 Plus   if (menuInfo.dwMenuData != tag)
Add comment 692 Plus   remove.Add(n);
Add comment 688 693 }
Add comment 689 694 }
Add comment 690 695
ShellTreeViewEx.cs
/Shell/ShellTreeViewEx.cs
/Shell/ShellTreeViewEx.cs
ShellViewEx.cs
/Shell/ShellViewEx.cs
/Shell/ShellViewEx.cs