Widow
/trunk/Widow/Helpers.cs |
@@ -48,26 +48,13 @@ |
return windows; |
} |
|
public static IEnumerable<IntPtr> EnumerateWindows() |
public static string GetWindowClass(IntPtr hWnd) |
{ |
var windows = new List<IntPtr>(); |
|
Natives.EnumWindows(delegate(IntPtr wnd, IntPtr param) |
{ |
windows.Add(wnd); |
return true; |
}, IntPtr.Zero); |
|
return windows; |
var windowClass = new StringBuilder(256); |
Natives.GetClassName(hWnd, windowClass, windowClass.Capacity); |
return windowClass.ToString(); |
} |
|
/// <summary> Find all windows that contain the given title text </summary> |
/// <param name="titleText"> The text that the window title must contain. </param> |
public static IEnumerable<IntPtr> FindWindowsWithText(string titleText) |
{ |
return FindWindows((wnd, param) => GetWindowText(wnd).Contains(titleText)); |
} |
|
public static string GetWindowTitle(IntPtr hWnd) |
{ |
var length = Natives.GetWindowTextLength(hWnd) + 1; |