如果你在使用findwindow的时候找不到窗口句柄,但是这个窗口又存在
那么你就可以使用下面的函数了
CString sz ="提示";
HWND hAll = ::GetDesktopWindow();
HWND hCurrent = ::GetNextWindow(hAll, GW_CHILD);
char szTittleDbg[256] = {0};
char *p = NULL;
while (hCurrent != NULL)
{
::GetWindowText(hCurrent, szTittleDbg, 256);
int iStrLength = strlen(szTittleDbg);
if (iStrLength != 0)
{
if (sz.Compare(szTittleDbg)==0)
{
break;
}
}
hCurrent = ::GetNextWindow(hCurrent, GW_HWNDNEXT);
}