Widow
/trunk/Widow/Helpers.cs/Helpers.cs |
@@ -48,6 +48,19 @@ |
return windows; |
} |
|
public static IEnumerable<IntPtr> EnumerateWindows() |
{ |
var windows = new List<IntPtr>(); |
|
Natives.EnumWindows(delegate(IntPtr wnd, IntPtr param) |
{ |
windows.Add(wnd); |
return true; |
}, IntPtr.Zero); |
|
return windows; |
} |
|
/// <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) |
@@ -63,14 +76,13 @@ |
return title.ToString(); |
} |
|
#endregion |
|
public static string GetProcessName(IntPtr hWnd) |
{ |
Natives.GetWindowThreadProcessId(hWnd, out var pid); |
var process = Process.GetProcessById((int)pid); |
var process = Process.GetProcessById((int) pid); |
return process.ProcessName; |
} |
|
} |
#endregion |
} |
} |