本文整理汇总了C++中CChildFrame::PostMessage方法的典型用法代码示例。如果您正苦于以下问题:C++ CChildFrame::PostMessage方法的具体用法?C++ CChildFrame::PostMessage怎么用?C++ CChildFrame::PostMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CChildFrame
的用法示例。
在下文中一共展示了CChildFrame::PostMessage方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ProcessClick
void CAdvTabCtrl::ProcessClick(UINT nFlags, CPoint point, int nClickButton)
{
try
{
TCHITTESTINFO hti;
hti.pt = point;
hti.flags = TCHT_ONITEM | TCHT_ONITEMICON | TCHT_ONITEMLABEL ;
int nTabID = HitTest(&hti);
TCITEM TabCtrlItem;
TabCtrlItem.mask = TCIF_PARAM;
GetItem(nTabID, &TabCtrlItem);
if(TabCtrlItem.lParam != NULL)
{
CChildFrame* tcf = ((CChildFrame*)TabCtrlItem.lParam);
if (!tcf || !tcf->m_pView)
return;
if (tcf->m_bProtect && !tcf->m_pView->m_bIsActive)
return;
//double click close
if((nClickButton==0 && pmf->m_nAllowDBC==1) || (nClickButton==1 && pmf->m_nAllowMC==1) || (nClickButton==2 && pmf->m_nAllowRC==1))
{
//2.2 313 post instead send
tcf->PostMessage(WM_CLOSE);//
tcf->m_pView->m_bToClose = TRUE;
//tcf->MDIDestroy();
}
else if((nClickButton==0 && pmf->m_nAllowDBC==2) || (nClickButton==1 && pmf->m_nAllowMC==2) || (nClickButton==2 && pmf->m_nAllowRC==2))
{
//save as
tcf->m_pView->PostMessage(WM_COMMAND, ID_FILE_SAVEAS, 0);
}
else if((nClickButton==0 && pmf->m_nAllowDBC==3) || (nClickButton==1 && pmf->m_nAllowMC==3) || (nClickButton==2 && pmf->m_nAllowRC==3))
{
//save html
tcf->m_pView->PostMessage(WM_COMMAND, ID_FILE_SAVEHTML, 0);
}
else if((nClickButton==0 && pmf->m_nAllowDBC==4) || (nClickButton==1 && pmf->m_nAllowMC==4) || (nClickButton==2 && pmf->m_nAllowRC==4))
{
//save html
tcf->m_pView->PostMessage(WM_COMMAND, ID_FILE_AUTOSAVE, 0);
}
else if((nClickButton==0 && pmf->m_nAllowDBC==5) || (nClickButton==1 && pmf->m_nAllowMC==5) || (nClickButton==2 && pmf->m_nAllowRC==5))
{
pmf->LockTab(tcf);
}
else if((nClickButton==0 && pmf->m_nAllowDBC==6) || (nClickButton==1 && pmf->m_nAllowMC==6) || (nClickButton==2 && pmf->m_nAllowRC==6))
{
tcf->m_pView->PowerRefresh();
}
}
}
catch(...){}
}
示例2: ClickCloseUp
BOOL CAdvTabCtrl::ClickCloseUp(CPoint point)
{
if (g_bCloseDown)
{
g_bCloseDown = 0;
if (TAB_NEED_CAPTURE)
ReleaseCapture();
if (g_bShowCloseIcon)
{
g_bShowCloseIcon = 0;
GetItem(g_nCloseTabID, &TabCtrlItem);
CChildFrame* tcf = ((CChildFrame*)TabCtrlItem.lParam);
if (!tcf) return FALSE ;
tcf->PostMessage(WM_CLOSE);
tcf->m_pView->m_bToClose = TRUE;
pmf->SetTabIcon(tcf->m_pView->m_nOlderIcon,g_nCloseTabID,tcf->m_pView);
return TRUE;
}
}
return FALSE;
}