16,471
社区成员
发帖
与我相关
我的任务
分享
HWND hWnds[2];
int nCount = 0;
BOOL CALLBACK CKeyDlg::FindMyWnd(HWND hwnd, LPARAM lParam)
{
if (!hwnd){
return TRUE;
}
TCHAR tzCaption[256];
::GetWindowText(hwnd, tzCaption, 256);
if (_tcsstr(tzCaption, _T("Tantra Launche")))
{
hWnds[nCount] = hwnd;
nCount++;
}
if(nCount == 2)
{
return FALSE;//结束枚举
}
return TRUE;
}
void CKeyDlg::OnButton6()
{
::EnumWindows(FindMyWnd, NULL);
}
HWND hWnds[2];
int nCount = 0;
BOOL CALLBACK FindMyWnd(HWND hwnd, LPARAM lParam)
{
if (!hwnd){
return TRUE;
}
TCHAR tzCaption[256];
::GetWindowText(hwnd, tzCaption, 256);
if (_tcsstr(tzCaption, _T("game")))
{
hWnds[nCount] = hwnd;
nCount++;
}
if(nCount == 2)
return FALSE;//结束枚举
return TRUE;
}
EnumWindows(&FindMyWnd, NULL);