Anyone have an idea why this wouldn't work?
IntPtr hWnd = FindWindow(null, "Calculator");
IntPtr hWnd2 = GetActiveWindow();
if(hWnd == hWnd2)
{
MessageBox.Show("Same");
}
Invokes are:
[DllImport("user32.dll")]
static extern IntPtr GetActiveWindow();
[DllImport("user32.dll", SetLastError = true)]
public static extern IntPtr FindWindow(string lpClassName, string lpWindowName);