本文整理汇总了C++中CChildFrame::GetItem方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::GetItem方法的具体用法?C++ CChildFrame::GetItem怎么用?C++ CChildFrame::GetItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::GetItem方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnGetToolTipInfo
LRESULT CTuotuoCategoryCtrl::OnGetToolTipInfo(LPNMHDR pnmh)
{
LPNMSTTDISPINFO pnmdsp = (LPNMSTTDISPINFO)pnmh;
pnmdsp->dwFlags = STTDSPF_TEXT;
if (pnmdsp->pdwIndex >= 1 && pnmdsp->pdwIndex <= 5)
pnmdsp->szText = _T("");
else if (pnmdsp->pdwIndex)
{
HWND hChildFrame = (HWND)pnmdsp->pdwIndex;
if (::IsWindow(hChildFrame))
{
CChildFrame *pChild = (CChildFrame*)::GetWindowLongPtr(hChildFrame, GWLP_USERDATA);
if (pChild)
{
if (pChild->GetItem()->m_pCategory->m_pWebData == START_PAGE_WEBSITE_DATA)
pnmdsp->szText = _T("我的首页");
else if (pChild->GetItem()->m_pCategory->m_pWebData)
pnmdsp->szText = pChild->GetItem()->GetText();
else
pnmdsp->szText = _T("");
}
else
pnmdsp->szText = _T("");
}
else
pnmdsp->szText = _T("");
}
else
pnmdsp->szText = _T("");
return 0;
}
示例2: OnCreateNewWebPage
// 创建一个新的页面标签页
LRESULT CMDIClient::OnCreateNewWebPage(UINT /* uMsg */, WPARAM wParam, LPARAM lParam)
{
if( !m_bSafe )
return NULL;
#ifndef SINGLE_PROCESS
CBankLoader::GetInstance()->Safeguard();
#endif
CRecordProgram::GetInstance()->RecordDebugInfo(MY_PRO_NAME, MY_COMMON_PROCESS, L"创建新的页面");
CreateNewWebPageData *pNewPage = (CreateNewWebPageData*)lParam;
std::tstring strURL = _T("about:blank");
std::tstring strAdditionalInfo;
if (IS_VALID_URL(pNewPage->lpszURL))
{
if (pNewPage->dwSize > 0) // >0表示url的指针只是一个flag,不是真实地址,需要转换
strURL = (LPCTSTR)((BYTE*)pNewPage + sizeof(CreateNewWebPageData));
else
strURL = pNewPage->lpszURL;
}
else if (pNewPage->lpszURL == URL_NO_NAVIGATE) // 点击链接打开新页面,此时不去navigate url,只是显示出来
{
if (pNewPage->dwSize > 0)
strURL = (LPCTSTR)((BYTE*)pNewPage + sizeof(CreateNewWebPageData));
else
strURL = _T(" ");
}
else if (pNewPage->lpszURL == URL_WITH_REFERER)
strURL = (LPCTSTR)((BYTE*)pNewPage + sizeof(CreateNewWebPageData));
else if (pNewPage->lpszURL == URL_WITH_POSTDATA)
{
strURL = (LPCTSTR)((BYTE*)pNewPage + sizeof(CreateNewWebPageData));
size_t nPos = strURL.find('\n');
if (nPos != std::wstring::npos)
{
strAdditionalInfo = strURL.substr(nPos + 1);
strURL = strURL.substr(0, nPos);
}
}
//std::wstring strDomain = ExtractTopDomain(strURL.c_str());
const CWebsiteData *pData;
// 当创建导入账单页面时,独自进行处理,在导入账单页进行,防止新开Tab页去独立显示
if(pNewPage->bGetBill == false)
pData = CURLList::GetInstance()->GetData(L"", strURL.c_str());
else
pData = CURLList::GetInstance()->GetData(L"getbill", strURL.c_str());
if (pData == NULL)
{
if (_tcsnicmp(strURL.c_str(), _T("http"), 4) == 0)
{
//::ShellExecute(NULL, _T("open"), strURL.c_str(), strURL.c_str(), NULL, SW_SHOW);
CListManager::NavigateWebPage(strURL.c_str());
CRecordProgram::GetInstance()->RecordCommonInfo(MY_PRO_NAME, MY_COMMON_PROCESS, L"NavigateWebPage创建新页面");
CRecordProgram::GetInstance()->RecordDebugInfo(MY_PRO_NAME, MY_COMMON_PROCESS, strURL.c_str());
return 0;
}
else
{
//MessageBox(strURL.c_str(), _T("配置文件错误"), MB_OK);
return 0;
}
}
std::tstring strChildFrameUrl;
CTabItem *pCreateFromItem = NULL;
if (::IsWindow(pNewPage->hCreateFromChildFrame))
{
CChildFrame *pChildFrame = (CChildFrame*)::GetWindowLongPtr(pNewPage->hCreateFromChildFrame, GWLP_USERDATA);
//ATLASSERT(!::IsBadReadPtr(pChildFrame, sizeof(CChildFrame)));
if (pChildFrame && !::IsBadReadPtr(pChildFrame, sizeof(CChildFrame)))
{
pCreateFromItem = pChildFrame->GetItem();
strChildFrameUrl = pCreateFromItem->GetURLText();
}
}
HWND hReturnChildFrame = NULL;
// 记住这里进行分类建立窗口的功能
CTabItem *pItem = new CTabItem(pNewPage->bNoClose);
CCategoryItem *pCate = m_CateCtrl.FindOrCreateItem(strURL == _T("about:blank") ? strChildFrameUrl.c_str() : strURL.c_str(), pCreateFromItem, pNewPage->bGetBill, pNewPage->BillFlag);//记账页强制创建新页面
pCate->m_TabItems.push_back(pItem);
pItem->m_pCategory = pCate;
DWORD dwProcessID = 0;
if (pCreateFromItem)
::GetWindowThreadProcessId(pCreateFromItem->GetAxControl(), &dwProcessID);
CChildFrame *pChild = new CChildFrame(FS(), m_hWnd, strURL.c_str(), pItem, pNewPage->lpszURL == URL_NO_NAVIGATE, false, dwProcessID, strChildFrameUrl);
if (m_CateCtrl.GetCurrentSelection() == pCate)
m_TabCtrl.InsertItem(m_TabCtrl.GetTabItems().size(), pItem);
if (pNewPage->bShowImmediately || m_TabCtrl.GetCurrentSelection() == NULL)
//.........这里部分代码省略.........