换季不换"气":MOVA Stellar X10让家时刻呼吸如新
2025-11-04
///全局函数和全局变量
HWND g_hWndArray[50]; //存所有窗口句柄
CString g_strArray[50]; //存所有窗口标题
int g_iWndCount = 0; //计数器
BOOL CALLBACK EnumWindowsProc(HWND hWnd, LPARAM lparam)
{
CWnd* pWnd = CWnd::FromHandle(hWnd);
if(hWnd != NULL && pWnd->IsWindowVisible())
{
pWnd->GetWindowText(g_strArray[g_iWndCount]);
if((!g_strArray[g_iWndCount].IsEmpty())
&& (g_strArray[g_iWndCount].CompareNoCase(L"Desktop") != 0))
{
g_hWndArray[g_iWndCount] = hWnd; //保存句柄
g_iWndCount++;
}
}
return TRUE;
}
BOOL CWndList::OnInitDialog()
{
::EnumWindows((WNDENUMPROC)EnumWindowsProc, 0); /////查找所有窗口
////创建大字体并加入到列表对象中
////将所有窗口句柄加入到列表中
}
///相应“切换”按钮
void CWndList::OnOK()
{
::SetForegroundWindow(g_hWndArray[m_List.GetCurSel()]); //m_List为列表对象
} 评论 {{userinfo.comments}}
{{child.content}}



{{question.question}}
提交