IntPtr hWnd = System.Diagnostics.Process.GetProcessesByName("AppName")[0].MainWindowHandle;
FindWindow 神马的弱爆了!