EnumWindows

来源:互联网 发布:mac pdf 书签 编辑:程序博客网 时间:2024/05/10 02:00
函数功能 该函数枚举所有屏幕上的顶层窗口,并将窗口句柄传送给应用程序定义的回调函数。

函数原型 BOOL EnumWindows(WNDENUMPROC lpEnumFunc,LPARAM lParam);
lPararm:指定一个传递给回调函数的应用程序定义值。
回调函数原型 BOOL CALLBACK EnumWindows.

::GetWindowText(m_wnd,m_store,128);
::GetClassName(m_wnd,m_strClass,MAX_PATH-1);

::EnumWindows(CTestDlg::EnumWindowsProc,NULL);
BOOL CTestDlg::EnumWindowsProc(HWND hWnd, LPARAM lParam)
{
if(::GetWindowLong(hWnd,GWL_STYLE)& WS_VISIBLE)
{
m_hwndFind[m_num] = hWnd;//record the HWND handle into array
m_num++;//count start
}
return 1;
}

0 0