大家看看这个FindWindow为什么老是为真 - C++ Builder / Windows SDK/API
bool CloseDialog(void){ HWND errorMsg1=NULL,errorMsg2=NULL; errorMsg1=::FindWindow("#32770","QQ对战平台"); if(errorMsg1)//这个if为什么在任何时候都是为真??????????????? { ShowMessage("找到msg1,正在关闭"); SendMessage(errorMsg1, WM_CLOSE, 0, 0); Sleep(200); errorMsg2=::FindWindow("#32770","错误"); if(errorMsg2) { ShowMessage("找到msg2,正在关闭"); SendMessage(errorMsg2, WM_CLOSE, 0, 0); } return false; } else return true;}