15,979
社区成员
发帖
与我相关
我的任务
分享
WCHAR classname [256];//这个是unicode版,如果你不是的话改成char classname [256];即可
WCHAR classname [256];
CWnd* pChild = GetWindow(GW_CHILD);//获得第一个子窗口
while (pChild)
{
classname [0] = 0;
::GetClassName(pChild->m_hWnd, classname, 256);//获得pChild类名,并保存在classname[]数组中
if (!wcscmp(classname, L"Button"))//判断类名是不是Button
{
}
if (!wcscmp(classname, L"Edit"))
{
}
pChild = pChild->GetNextWindow();//获得下一个(或先前一个)窗口
}