16,551
社区成员
发帖
与我相关
我的任务
分享VOID OutputWindow(HWND hWnd)
{
TCHAR szTitle[256] = {0};
GetWindowText(hWnd, szTitle, sizeof(szTitle) / sizeof(TCHAR));
TCHAR szBuffer[MAX_PATH] = {0};
_sntprintf(szBuffer, sizeof(szBuffer) / sizeof(TCHAR) - 1, _T("HWND(%x), Title(%s)\n"), (UINT)hWnd, szTitle);
OutputDebugString(szBuffer);
}
void EnumChild(HWND hParent)
{
if(hParent != NULL)
{
HWND hChild = GetWindow(hParent, GW_CHILD);
while(hChild != NULL)
{
EnumChild(hChild);
OutputWindow(hChild);
hChild = GetWindow(hChild, GW_HWNDNEXT);
}
}
}