Returns the top-level CWnd whose window class is given by lpszClassName and whose window name, or title, is given by lpszWindowName.static CWnd* PASCAL FindWindow( LPCTSTR lpszClassName, LPCTSTR lpszWindowName );
Example // activate an application with a window with a specific class name BOOL COneT32App::FirstInstance() { CWnd *pWndPrev, *pWndChild; // Determine if a window with the class name exists... if (pWndPrev = CWnd::FindWindow(_T("MyNewClass"),NULL)) { // If so, does it have any popups? pWndChild = pWndPrev->GetLastActivePopup(); // If iconic, restore the main window if (pWndPrev->IsIconic()) pWndPrev->ShowWindow(SW_RESTORE); // Bring the main window or its popup to the foreground pWndChild->SetForegroundWindow(); // and you are done activating the other application return FALSE; } }
LPCTSTR lpszClassName,
LPCTSTR lpszWindowName
);
// activate an application with a window with a specific class name
BOOL COneT32App::FirstInstance()
{
CWnd *pWndPrev, *pWndChild; // Determine if a window with the class name exists...
if (pWndPrev = CWnd::FindWindow(_T("MyNewClass"),NULL))
{
// If so, does it have any popups?
pWndChild = pWndPrev->GetLastActivePopup(); // If iconic, restore the main window
if (pWndPrev->IsIconic())
pWndPrev->ShowWindow(SW_RESTORE); // Bring the main window or its popup to the foreground
pWndChild->SetForegroundWindow(); // and you are done activating the other application
return FALSE;
}
}
LPCTSTR lpszClassName,
LPCTSTR lpszWindowName
);找到另一个对话框得句柄,然后操作
在CPropertySheet中又包含了两个对话框, 就是那种Tab界面.
现在在主对话框中的一个函数需要更新某一个Tab界面上的一个控件.
CPropertySheet m_sheet;
m_sheet.m_page1.m_ctrl.UpdateData(false);
请问一下, m_page1 是m_sheet的成员? thx