LRESULT CTangramTabCtrlWnd::OnCreatePage(WPARAM wParam, LPARAM lParam) { HWND hPageWnd = (HWND)wParam; //CTabPageWnd* pWnd = new CTabPageWnd(); //pWnd->SubclassWindow(hPageWnd); CWnd* pWnd = FromHandlePermanent(hPageWnd); if (pWnd == NULL) { pWnd = new CTabPageWnd(); pWnd->SubclassWindow(hPageWnd); } AddTab(pWnd, (LPCTSTR)lParam, (UINT)GetTabsNum()-1); //AddTab(pView,LPCTSTR(pObj->m_strCaption),0); //if(nIndex==m_pTangramXMLObj->m_nActivePage) //{ // SetFocusedItem(pItem); //} //AddPage(pWnd,(LPCTSTR)lParam); //SendMessage(WM_TGM_SETACTIVEPAGE); InvalidateRect(NULL); //if(pWnd) //{ // pWnd->UnsubclassWindow(); // delete pWnd; //} return 0; }
// CMFCTabCtrlEx 메시지 처리기입니다. LRESULT CMFCTabCtrlEx::OnCloseEpub(WPARAM wParam, LPARAM lParam) { TRACE(_T("CMFCTabCtrlEx::OnCloseEpub() START\r\n")); // HRESULT hr = S_OK; // Remove epub theApp.m_WebkitEngine.Close((CWnd *)wParam); // Remove tab int tabID = (int)lParam; int index = GetTabByID(tabID); if(index >= 0) { int next = -1; if(index + 1 < GetTabsNum()) next = index + 1; else if( index - 1 >= 0 ) next = index - 1; // if( next >= 0) { SetActiveTab(next); ShowTab(next); } if(!RemoveTab(index)) return S_FALSE; } // TRACE(_T("CMFCTabCtrlEx::OnCloseEpub() END\r\n")); return hr; }
LRESULT CTangramTabCtrlWnd::OnTgmSetCaption(WPARAM wParam, LPARAM lParam) { int iIndex = (int)wParam; int iCount = GetTabsNum(); //CXTPTabManagerItem* pItem = GetItem(iIndex); //pItem->SetCaption(CString((LPTSTR)lParam)); return 0; }
LRESULT CTangramTabCtrlWnd::OnActiveTangramObj(WPARAM wParam, LPARAM lParam) { int iCount = GetTabsNum(); if (m_pTangramNode) { CComPtr<ITangramNodeCollection> pCol; m_pTangramNode->get_ChildNodes(&pCol); long nCount = 0; pCol->get_NodeCount(&nCount); for (int i = 0; i<nCount; i++) { CComPtr<ITangramNode> pNode; pCol->get_Item(i, &pNode); HWND hWnd; pNode->get_Handle((LONGLONG*)&hWnd); ::PostMessage(hWnd, WM_TGM_SETACTIVEPAGE, wParam, lParam); } } return 0; }