MFC枚举窗口

bool C枚举窗口Dlg::EnumWindowsProc(HWND hWnd, LPARAM lParam)
{
	if(::GetWindowLong(hWnd,GWL_STYLE)& WS_VISIBLE)
	{
		m_hwndFind[m_num] = hWnd;//record the HWND handle into array
	}
	return true;
}

void C枚举窗口Dlg::OnBnClickedButton2()
{
	::EnumWindows((WNDENUMPROC)(C枚举窗口Dlg::EnumWindowsProc),NULL);
}

你可能感兴趣的:(c/c++)