private bool EnumWindowCallBack(IntPtr hwnd, int lParam) { if (lParam == 0) { Window W = new Window(hwnd); bool IsAdd = true; if (_FilterBlanks && W.WindowText == "") IsAdd = false; if (_FilterHidden && !W.IsVisible) IsAdd = false; if (_FilterChildren && W.GetOwner != IntPtr.Zero) IsAdd = false; foreach (string S in _FilterStrings) if (W.WindowText == S) IsAdd = false; if (IsAdd) this.Add(W); } _EnumComplete = lParam; return true; }
public bool EnumWindowCallBack(IntPtr hwnd, int lParam) { if (lParam == 0) { Window W = new Window(hwnd); bool IsAdd = true; if (_FilterBlanks && W.WindowText == "") IsAdd = false; if (_FilterHidden && !W.IsVisible) IsAdd = false; if (_FilterChildren && W.GetOwner != IntPtr.Zero) IsAdd = false; foreach (string S in _FilterStrings) if (W.WindowText == S) IsAdd = false; //IsAdd = W.WindowText.lower().contains("notepad"); if (IsAdd) { "adding window:{0}".debug(W.WindowText); this.Add(W); } } _EnumComplete = lParam; return true; }
private void Shell_WindowCreated(IntPtr Handle) { // This event is called when a new top-level window is created. We create a Window object to function // as an internal wrapper to this window. Window W = new Window(Handle); _Windows.Add(W); UpdateWindowList(); }