private void RecaptureHandles(IntPtr hwndShellView)
        {
            if (CurrentListView != null)
            {
                CurrentListView.Dispose();
            }

            hwndEnumResult = IntPtr.Zero;
            PInvoke.EnumChildWindows(hwndShellView, CallbackEnumChildProc_ListView, IntPtr.Zero);
            if (hwndEnumResult == IntPtr.Zero)
            {
                CurrentListView = new AbstractListView();
            }
            else if (fIsSysListView)
            {
                CurrentListView = new ExtendedSysListView32(ShellBrowser, hwndShellView, hwndEnumResult, hwndSubDirTipMessageReflect);
            }
            else
            {
                if (AutoMan == null)
                {
                    AutoMan = new AutomationManager();
                }
                CurrentListView = new ExtendedItemsView(ShellBrowser, hwndShellView, hwndEnumResult, hwndSubDirTipMessageReflect, AutoMan);
            }
            CurrentListView.ListViewDestroyed += ListView_Destroyed;
            ListViewChanged(this, null);
        }
 private void ListView_Destroyed(object sender, EventArgs args)
 {
     if (CurrentListView == sender)
     {
         CurrentListView.Dispose();
         CurrentListView = new AbstractListView();
         ListViewChanged(this, null);
     }
 }
 public void Initialize() {
     IntPtr hwndShellView = WindowUtils.FindChildWindow(hwndExplorer, hwnd => PInvoke.GetClassName(hwnd) == "SHELLDLL_DefView");
     if(hwndShellView == IntPtr.Zero) {
         if(CurrentListView != null) {
             CurrentListView.Dispose();
         }
         CurrentListView = new AbstractListView();
         ListViewChanged(this, null);
     }
     else {
         RecaptureHandles(hwndShellView);
     }
 }
        private void RecaptureHandles(IntPtr hwndShellView)
        {
            bool   fIsSysListView = false;
            IntPtr hwndListView   = WindowUtils.FindChildWindow(hwndShellView, hwnd => {
                string name = PInvoke.GetClassName(hwnd);
                if (name == "SysListView32")
                {
                    fIsSysListView = true;
                    return(true);
                }
                else if (!QTUtility.IsXP && name == "DirectUIHWND")
                {
                    fIsSysListView = false;
                    return(true);
                }
                return(false);
            });

            if (CurrentListView != null)
            {
                if (CurrentListView.Handle == hwndListView)
                {
                    return;
                }
                PreviousListView = CurrentListView;
            }

            if (hwndListView == IntPtr.Zero)
            {
                CurrentListView = new AbstractListView();
            }
            else if (fIsSysListView)
            {
                CurrentListView = new ExtendedSysListView32(ShellBrowser, hwndShellView, hwndListView, hwndSubDirTipMessageReflect);
            }
            else
            {
                if (AutoMan == null)
                {
                    AutoMan = new AutomationManager();
                }
                CurrentListView = new ExtendedItemsView(ShellBrowser, hwndShellView, hwndListView, hwndSubDirTipMessageReflect, AutoMan);
            }
            CurrentListView.ListViewDestroyed += ListView_Destroyed;
            ListViewChanged(this, null);
        }
Beispiel #5
0
        public void Initialize()
        {
            IntPtr hwndShellView = WindowUtils.FindChildWindow(hwndExplorer, hwnd => PInvoke.GetClassName(hwnd) == "SHELLDLL_DefView");

            if (hwndShellView == IntPtr.Zero)
            {
                if (CurrentListView != null)
                {
                    CurrentListView.Dispose();
                }
                CurrentListView = new AbstractListView();
                ListViewChanged(this, null);
            }
            else
            {
                RecaptureHandles(hwndShellView);
            }
        }
 public void Dispose()
 {
     if (fDisposed)
     {
         return;
     }
     if (CurrentListView != null)
     {
         CurrentListView.Dispose();
         CurrentListView = null;
     }
     if (AutoMan != null)
     {
         AutoMan.Dispose();
         AutoMan = null;
     }
     fDisposed = true;
 }
 public void Initialize()
 {
     hwndEnumResult = IntPtr.Zero;
     PInvoke.EnumChildWindows(hwndExplorer, CallbackEnumChildProc_ShellView, IntPtr.Zero);
     if (hwndEnumResult == IntPtr.Zero)
     {
         if (CurrentListView != null)
         {
             CurrentListView.Dispose();
         }
         CurrentListView = new AbstractListView();
         ListViewChanged(this, null);
     }
     else
     {
         RecaptureHandles(hwndEnumResult);
     }
 }
Beispiel #8
0
 private void ListView_Destroyed(object sender, EventArgs args)
 {
     if (sender == CurrentListView)
     {
         if (PreviousListView != null)
         {
             CurrentListView  = PreviousListView;
             PreviousListView = null;
         }
         else
         {
             CurrentListView = new AbstractListView();
         }
         ListViewChanged(this, null);
     }
     else if (sender == PreviousListView)
     {
         PreviousListView = null;
     }
     ((AbstractListView)sender).Dispose();
 }
 public void Initialize() {
     hwndEnumResult = IntPtr.Zero;
     PInvoke.EnumChildWindows(hwndExplorer, CallbackEnumChildProc_ShellView, IntPtr.Zero);
     if(hwndEnumResult == IntPtr.Zero) {
         if(CurrentListView != null) {
             CurrentListView.Dispose();
         }
         CurrentListView = new AbstractListView();
         ListViewChanged(this, null);
     }
     else {
         RecaptureHandles(hwndEnumResult);
     }
 }
 public void Dispose() {
     if(fDisposed) return;
     if(CurrentListView != null) {
         CurrentListView.Dispose();
         CurrentListView = null;
     }
     if(AutoMan != null) {
         AutoMan.Dispose();
         AutoMan = null;
     }
     fDisposed = true;
 }
 private void ListView_Destroyed(object sender, EventArgs args) {
     if(CurrentListView == sender) {
         CurrentListView.Dispose();
         CurrentListView = new AbstractListView();
         ListViewChanged(this, null);
     }
 }
        private void RecaptureHandles(IntPtr hwndShellView) {
            if(CurrentListView != null) {
                CurrentListView.Dispose();
            }

            hwndEnumResult = IntPtr.Zero;
            PInvoke.EnumChildWindows(hwndShellView, CallbackEnumChildProc_ListView, IntPtr.Zero);
            if(hwndEnumResult == IntPtr.Zero) {
                CurrentListView = new AbstractListView();
            }
            else if(fIsSysListView) {
                CurrentListView = new ExtendedSysListView32(ShellBrowser, hwndShellView, hwndEnumResult, hwndSubDirTipMessageReflect);
            }
            else {
                if(AutoMan == null) {
                    AutoMan = new AutomationManager();
                }
                CurrentListView = new ExtendedItemsView(ShellBrowser, hwndShellView, hwndEnumResult, hwndSubDirTipMessageReflect, AutoMan);
            }
            CurrentListView.ListViewDestroyed += ListView_Destroyed;
            ListViewChanged(this, null);
        }
 private void ListViewMonitor_ListViewChanged(object sender, EventArgs args) {
     listView = listViewManager.CurrentListView;
     ExtendedListViewCommon elvc = listView as ExtendedListViewCommon;
     if(elvc != null) {
         elvc.ItemCountChanged += ListView_ItemCountChanged;
         elvc.ItemActivated += ListView_ItemActivated;
         elvc.SelectionChanged += ListView_SelectionChanged;
         elvc.MiddleClick += ListView_MiddleClick;
         elvc.DoubleClick += ListView_DoubleClick;
         elvc.EndLabelEdit += ListView_EndLabelEdit;
         elvc.MouseActivate += ListView_MouseActivate;
         elvc.SubDirTip_MenuItemClicked += subDirTip_MenuItemClicked;
         elvc.SubDirTip_MenuItemRightClicked += subDirTip_MenuItemRightClicked;
         elvc.SubDirTip_MultipleMenuItemsClicked += subDirTip_MultipleMenuItemsClicked;
         elvc.SubDirTip_MultipleMenuItemsRightClicked += subDirTip_MultipleMenuItemsRightClicked;               
     }
     HandleF5();
 }
Beispiel #14
0
        private void RecaptureHandles(IntPtr hwndShellView)
        {
            bool fIsSysListView = false;
            IntPtr hwndListView = WindowUtils.FindChildWindow(hwndShellView, hwnd => {
                string name = PInvoke.GetClassName(hwnd);
                if(name == "SysListView32") {
                    fIsSysListView = true;
                    return true;
                }
                else if(!QTUtility.IsXP && name == "DirectUIHWND") {
                    fIsSysListView = false;
                    return true;
                }
                return false;
            });

            if(CurrentListView != null) {
                if(CurrentListView.Handle == hwndListView) {
                    return;
                }
                PreviousListView = CurrentListView;
            }

            if(hwndListView == IntPtr.Zero) {
                CurrentListView = new AbstractListView();
            }
            else if(fIsSysListView) {
                CurrentListView = new ExtendedSysListView32(ShellBrowser, hwndShellView, hwndListView, hwndSubDirTipMessageReflect);
            }
            else {
                CurrentListView = new ExtendedItemsView(ShellBrowser, hwndShellView, hwndListView, hwndSubDirTipMessageReflect);
            }
            CurrentListView.ListViewDestroyed += ListView_Destroyed;
            ListViewChanged(this, null);
        }
Beispiel #15
0
 private void ListView_Destroyed(object sender, EventArgs args)
 {
     if(sender == CurrentListView) {
         if(PreviousListView != null) {
             CurrentListView = PreviousListView;
             PreviousListView = null;
         }
         else {
             CurrentListView = new AbstractListView();
         }
         ListViewChanged(this, null);
     }
     else if(sender == PreviousListView) {
         PreviousListView = null;
     }
     ((AbstractListView)sender).Dispose();
 }