当前位置: 首页>>代码示例>>C++>>正文


C++ CChildFrame::PostMessage方法代码示例

本文整理汇总了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(...){}
}
开发者ID:yning,项目名称:FormerWork,代码行数:53,代码来源:AdvTabCtrl.cpp

示例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;
}
开发者ID:yning,项目名称:FormerWork,代码行数:21,代码来源:AdvTabCtrl.cpp


注:本文中的CChildFrame::PostMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。