Widow – Diff between revs 12 and 14
?pathlinks?
Rev 12 | Rev 14 | |||
---|---|---|---|---|
Line 46... | Line 46... | |||
46 | }, IntPtr.Zero); |
46 | }, IntPtr.Zero); |
|
Line 47... | Line 47... | |||
47 | |
47 | |
|
48 | return windows; |
48 | return windows; |
|
Line 49... | Line 49... | |||
49 | } |
49 | } |
|
50 | |
50 | |
|
51 | public static IEnumerable<IntPtr> EnumerateWindows() |
51 | public static string GetWindowClass(IntPtr hWnd) |
|
52 | { |
- | ||
53 | var windows = new List<IntPtr>(); |
52 | { |
|
54 | |
- | ||
55 | Natives.EnumWindows(delegate(IntPtr wnd, IntPtr param) |
- | ||
56 | { |
- | ||
57 | windows.Add(wnd); |
- | ||
58 | return true; |
- | ||
59 | }, IntPtr.Zero); |
53 | var windowClass = new StringBuilder(256); |
|
60 | |
- | ||
61 | return windows; |
- | ||
62 | } |
- | ||
63 | |
- | ||
64 | /// <summary> Find all windows that contain the given title text </summary> |
- | ||
65 | /// <param name="titleText"> The text that the window title must contain. </param> |
- | ||
66 | public static IEnumerable<IntPtr> FindWindowsWithText(string titleText) |
- | ||
67 | { |
54 | Natives.GetClassName(hWnd, windowClass, windowClass.Capacity); |
|
Line 68... | Line 55... | |||
68 | return FindWindows((wnd, param) => GetWindowText(wnd).Contains(titleText)); |
55 | return windowClass.ToString(); |
|
69 | } |
56 | } |
|
70 | |
57 | |