internal ListViewMonitor(ShellBrowserEx shellBrowser, IntPtr hwndExplorer, IntPtr hwndSubDirTipMessageReflect) { ShellBrowser = shellBrowser; this.hwndExplorer = hwndExplorer; this.hwndSubDirTipMessageReflect = hwndSubDirTipMessageReflect; hwndShellContainer = QTUtility.IsXP ? hwndExplorer : WindowUtils.FindChildWindow(hwndExplorer, hwnd => PInvoke.GetClassName(hwnd) == "ShellTabWindowClass"); if (hwndShellContainer != IntPtr.Zero) { ContainerController = new NativeWindowController(hwndShellContainer); ContainerController.MessageCaptured += ContainerController_MessageCaptured; } }
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); }
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); } }
protected override IntPtr GetEditControl() { return(WindowUtils.FindChildWindow(Handle, hwnd => PInvoke.GetClassName(hwnd) == "Edit")); }