int handle = FindWindow(null, "XXX");
if (handle == 0)//0说明不存在
[DllImport("User32.dll", EntryPoint = "FindWindow")]
private static extern int FindWindow(string lpClassName, string lpWindowName);