LPCSTR lpszWindowName; ....... if(lpszWindowName == ".....") { ..... } //上面是无法正确获得结果的,应该用下面的方法 if(memcmp(lpszWindowName, "......", 6) == 0) { ..... }