indow(string Title, IntPtr hWnd, string Process)
{
m_Title = Title;
m_hWnd = hWnd;
m_Process = Process;
}
//Override ToString()
public override string ToString()
{
//return the title if it has one, if not return the process name
if (m_Title.Length > 0)
{
return m_Title;
}
else
{
return m_Process;
}
}
/// <summary>
/// Sets focus to this Window Object
/// </summary>
public void Activate()
{
if(m_hWnd == GetForegroundWindow())
return;
IntPtr ThreadID1 = GetWindowThreadProcessId(GetForegroundWindow(),
IntPtr.Zero);
IntPtr ThreadID2 = GetWindowThreadProcessId(m_hWnd,IntPtr.Zero);
if (ThreadID1 != ThreadID2)
{
&nb