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


C++ CVConGuard::VCon方法代码示例

本文整理汇总了C++中CVConGuard::VCon方法的典型用法代码示例。如果您正苦于以下问题:C++ CVConGuard::VCon方法的具体用法?C++ CVConGuard::VCon怎么用?C++ CVConGuard::VCon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CVConGuard的用法示例。


在下文中一共展示了CVConGuard::VCon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: ChooseTabFromMenu

void CConEmuCtrl::ChooseTabFromMenu(BOOL abFirstTabOnly, POINT pt, DWORD Align /*= TPM_CENTERALIGN|TPM_VCENTERALIGN*/)
{
	HMENU hPopup = gpConEmu->mp_Menu->CreateVConListPopupMenu(NULL, abFirstTabOnly);

	if (!Align)
		Align = TPM_LEFTALIGN|TPM_TOPALIGN;

	int nTab = gpConEmu->mp_Menu->trackPopupMenu(tmp_TabsList, hPopup, Align|TPM_RETURNCMD,
		pt.x, pt.y, ghWnd);

	if (nTab >= IDM_VCON_FIRST && nTab <= IDM_VCON_LAST)
	{
		int nNewV = ((int)HIWORD(nTab))-1;
		int nNewR = ((int)LOWORD(nTab))-1;

		CVConGuard VCon;
		if (CVConGroup::GetVCon(nNewV, &VCon))
		{
			CRealConsole* pRCon = VCon->RCon();
			if (pRCon)
			{
				CTab tab(__FILE__,__LINE__);
				if (pRCon->GetTab(nNewR, tab))
					pRCon->ActivateFarWindow(tab->Info.nFarWindowID);
			}
			if (!VCon->isActive(false))
				gpConEmu->Activate(VCon.VCon());
		}
	}

	DestroyMenu(hPopup);
}
开发者ID:negadj,项目名称:ConEmu,代码行数:32,代码来源:ConEmuCtrl.cpp

示例2: CountActiveTabs

int CTabBarClass::CountActiveTabs(int nMax /*= 0*/)
{
	int  nTabs = 0;
	bool bHideInactiveConsoleTabs = gpSet->bHideInactiveConsoleTabs;

	for (int V = 0; V < MAX_CONSOLE_COUNT; V++)
	{
		CVConGuard guard;
		if (!CVConGroup::GetVCon(V, &guard))
			continue;
		CVirtualConsole* pVCon = guard.VCon();

		if (bHideInactiveConsoleTabs)
		{
			if (!pVCon->isVisible())
				continue;
		}

		nTabs += pVCon->RCon()->GetTabCount(TRUE);

		if ((nMax > 0) && (nTabs >= nMax))
			break;
	}

	return nTabs;
}
开发者ID:negadj,项目名称:ConEmu,代码行数:26,代码来源:TabBar.cpp

示例3: GetVConFromTab

bool CTabBarClass::GetVConFromTab(int nTabIdx, CVConGuard* rpVCon, DWORD* rpWndIndex)
{
	bool lbRc = false;
	CTab tab(__FILE__,__LINE__);
	CVConGuard VCon;
	DWORD wndIndex = 0;

	if (m_Tabs.GetTabByIndex(nTabIdx, tab))
	{
		wndIndex = tab->Info.nFarWindowID;

		if (!gpConEmu->isValid((CVirtualConsole*)tab->Info.pVCon))
		{
			RequestPostUpdate();
		}
		else
		{
			VCon = (CVirtualConsole*)tab->Info.pVCon;
			lbRc = true;
		}
	}

	if (rpVCon)
		rpVCon->Attach(VCon.VCon());

	if (rpWndIndex)
		*rpWndIndex = lbRc ? wndIndex : 0;

	return lbRc;
}
开发者ID:negadj,项目名称:ConEmu,代码行数:30,代码来源:TabBar.cpp

示例4: key_WinSize

// Общая для key_WinWidthDec/key_WinWidthInc/key_WinHeightDec/key_WinHeightInc
// pRCon may be NULL
bool CConEmuCtrl::key_WinSize(BYTE vk)
{
	if (gpConEmu->isFullScreen() || gpConEmu->isZoomed() || gpConEmu->isIconic())
	{
		// ничего не делать
	}
	else
	{
		CVConGuard VCon;
		CVirtualConsole* pVCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;
		RECT rcWindow = {};
		if (GetWindowRect(ghWnd, &rcWindow))
		{
			RECT rcMon = gpConEmu->CalcRect(CER_MONITOR, rcWindow, CER_MONITOR, pVCon);
			int nX = gpSetCls->FontWidth();
			int nY = gpSetCls->FontHeight();
			if (vk == VK_LEFT)
			{
				rcWindow.right = rcWindow.right - nX;
			}
			else if (vk == VK_RIGHT)
			{
				if ((rcWindow.right + nX) < rcMon.right)
					rcWindow.right = rcWindow.right + nX;
			}
			else if (vk == VK_UP)
			{
				rcWindow.bottom = rcWindow.bottom - nY;
			}
			else if (vk == VK_DOWN)
			{
				if ((rcWindow.bottom + nY) < rcMon.bottom)
					rcWindow.bottom = rcWindow.bottom + nY;
			}

			if (rcWindow.right > rcWindow.left && rcWindow.bottom > rcWindow.top)
			{
				MoveWindowRect(ghWnd, rcWindow, TRUE);
			}
		}
		//
		//CRealConsole* pRCon = pVCon ? pVCon->RCon() : NULL;
		//if (pRCon)
		//{
		//
		//	//if (!pRCon->GuiWnd())
		//	//{
		//	//
		//	//}
		//	//else
		//	//{
		//	//	// Ресайз в ГУИ режиме
		//	//}
		//}
	}
	return true;
}
开发者ID:negadj,项目名称:ConEmu,代码行数:59,代码来源:ConEmuCtrl.cpp

示例5: OnPostLocalize

void CSetPgInfo::OnPostLocalize(HWND hDlg)
{
	CVirtualConsole* pVCon = NULL;
	CVConGuard VCon;
	if (CVConGroup::GetActiveVCon(&VCon) >= 0)
		pVCon = VCon.VCon();

	// Performance
	gpSetCls->Performance(gbPerformance, TRUE);

	if (pVCon)
	{
		FillConsoleMode(hDlg, pVCon->RCon());
	}
}
开发者ID:2asoft,项目名称:ConEmu,代码行数:15,代码来源:SetPgInfo.cpp

示例6: OnInitDialog

LRESULT CSetPgInfo::OnInitDialog(HWND hDlg, bool abInitial)
{
	CVirtualConsole* pVCon = NULL;
	CVConGuard VCon;
	if (CVConGroup::GetActiveVCon(&VCon) >= 0)
		pVCon = VCon.VCon();

	SetDlgItemText(hDlg, tCurCmdLine, GetCommandLine());

	gpConEmu->UpdateProcessDisplay(TRUE);

	gpConEmu->UpdateSizes();

	if (pVCon)
	{
		ConsoleInfoArg cursorInfo = {};
		pVCon->RCon()->GetConsoleInfo(&cursorInfo);
		FillCursorInfo(hDlg, &cursorInfo);
	}

	FillFontInfo(hDlg);

	return 0;
}
开发者ID:2asoft,项目名称:ConEmu,代码行数:24,代码来源:SetPgInfo.cpp

示例7: ActiveTabByName

int CTabBarClass::ActiveTabByName(int anType, LPCWSTR asName, CVConGuard* rpVCon)
{
	int nTab = -1;

	if (rpVCon)
		rpVCon->Release();

	TODO("TabBarClass::ActiveTabByName - найти таб по имени");

	INT_PTR V, I;
	int tabIdx = 0;

	CVConGuard VCon;
	for (V = 0; (nTab == -1) && CVConGroup::GetVCon(V, &VCon, true); V++)
	{
		#ifdef _DEBUG
		bool lbActive = VCon->isActive(false);
		#endif

		//111120 - Эту опцию игнорируем. Если редактор открыт в другой консоли - активируем ее потом
		//if (gpSet->bHideInactiveConsoleTabs)
		//{
		//	if (!lbActive) continue;
		//}

		CRealConsole *pRCon = VCon->RCon();

		for (I = 0; TRUE; I++)
		{
			CTab tab(__FILE__,__LINE__);
			if (!pRCon->GetTab(I, tab))
				break;

			if (tab->Type() == (anType & fwt_TypeMask))
			{
				// Тут GetName() использовать нельзя, т.к. оно может возвращать "переименованное пользователем"
				// А здесь ищется конкретный редактор-вьювер фара (то есть нужно правильное полное имя-путь к файлу)
				LPCWSTR pszNamePtr = tab->Name.Ptr();
				// If asName (searched file) has been specified with path, we need to compare with tab full path
				LPCWSTR pszCompareTab = wcspbrk(asName, L"\\/") ? pszNamePtr : PointToName(pszNamePtr);
				if (pszNamePtr && ((lstrcmpi(pszCompareTab, asName) == 0)))
				{
					nTab = tabIdx;
					break;
				}
			}

			tabIdx++;
		}
	}


	if (nTab >= 0)
	{
		if (!CanActivateTab(nTab))
		{
			nTab = -2;
		}
		else
		{
			if (!mp_Rebar->FarSendChangeTab(nTab, &VCon))
				nTab = -2;
		}
	}

	if (rpVCon)
		rpVCon->Attach(VCon.VCon());

	return nTab;
}
开发者ID:negadj,项目名称:ConEmu,代码行数:70,代码来源:TabBar.cpp

示例8: OnCommand

void CTabBarClass::OnCommand(WPARAM wParam, LPARAM lParam)
{
	if (!this)
		return;

	if (!mp_Rebar->IsToolbarCommand(wParam, lParam))
		return;

	if (!gpSet->isMultiShowButtons)
	{
		_ASSERTE(gpSet->isMultiShowButtons);
		return;
	}

	if (wParam == TID_ACTIVE_NUMBER)
	{
		//gpConEmu->ConActivate(wParam-1);
		OnChooseTabPopup();
	}
	else if (wParam == TID_CREATE_CON)
	{
		if (gpConEmu->IsGesturesEnabled())
			gpConEmu->mp_Menu->OnNewConPopupMenu(NULL, 0, isPressed(VK_SHIFT));
		else
			gpConEmu->RecreateAction(gpSetCls->GetDefaultCreateAction(), gpSet->isMultiNewConfirm || isPressed(VK_SHIFT));
	}
	else if (wParam == TID_ALTERNATIVE)
	{
		CVConGuard VCon;
		CVirtualConsole* pVCon = (gpConEmu->GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;
		// Вернуть на тулбар _текущее_ состояние режима
		mp_Rebar->SetToolBtnChecked(TID_ALTERNATIVE, pVCon ? pVCon->RCon()->isAlternative() : false);
		// И собственно Action
		gpConEmu->AskChangeAlternative();
	}
	else if (wParam == TID_SCROLL)
	{
		CVConGuard VCon;
		CVirtualConsole* pVCon = (gpConEmu->GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;
		// Вернуть на тулбар _текущее_ состояние режима
		mp_Rebar->SetToolBtnChecked(TID_SCROLL, pVCon ? pVCon->RCon()->isBufferHeight() : false);
		// И собственно Action
		gpConEmu->AskChangeBufferHeight();
	}
	else if (wParam == TID_MINIMIZE)
	{
		PostMessage(ghWnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
	}
	else if (wParam == TID_MAXIMIZE)
	{
		// Чтобы клик случайно не провалился в консоль
		gpConEmu->mouse.state |= MOUSE_SIZING_DBLCKL;
		// Аналог AltF9
		gpConEmu->DoMaximizeRestore();
	}
	else if (wParam == TID_APPCLOSE)
	{
		gpConEmu->PostScClose();
	}
	//else if (wParam == TID_COPYING)
	//{
	//	gpConEmu->OnCopyingState();
	//}
	else if (wParam == TID_SYSMENU)
	{
		RECT rcBtnRect = {0};
		mp_Rebar->GetToolBtnRect(TID_SYSMENU, &rcBtnRect);
		DWORD nAddFlags = ((gpSet->nTabsLocation == 1) ? TPM_BOTTOMALIGN : 0) | TPM_RIGHTALIGN;
		LogString(L"ShowSysmenu called from (ToolBar)");
		gpConEmu->mp_Menu->ShowSysmenu(rcBtnRect.right,rcBtnRect.bottom, nAddFlags);
	}
	else
	{
		_ASSERTE(FALSE && "Toolbar click was not processed");
	}
}
开发者ID:negadj,项目名称:ConEmu,代码行数:76,代码来源:TabBar.cpp

示例9: OnNotify

bool CTabBarClass::OnNotify(LPNMHDR nmhdr, LRESULT& lResult)
{
	if (!this)
		return false;

	if (!_active)
		return false;

	lResult = 0;

	if (mp_Rebar->OnNotifyInt(nmhdr, lResult))
		return true;


	if (nmhdr->code == TBN_GETINFOTIP && mp_Rebar->IsToolbarNotify(nmhdr))
	{
		if (!gpSet->isMultiShowButtons)
			return false;

		LPNMTBGETINFOTIP pDisp = (LPNMTBGETINFOTIP)nmhdr;

		//if (pDisp->iItem>=1 && pDisp->iItem<=MAX_CONSOLE_COUNT)
		if (pDisp->iItem == TID_ACTIVE_NUMBER)
		{
			if (!pDisp->pszText || !pDisp->cchTextMax)
				return true;

			CVConGuard VCon;
			CVirtualConsole* pVCon = (gpConEmu->GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;
			LPCWSTR pszTitle = pVCon ? pVCon->RCon()->GetTitle() : NULL;

			if (pszTitle)
			{
				lstrcpyn(pDisp->pszText, pszTitle, pDisp->cchTextMax);
			}
			else
			{
				pDisp->pszText[0] = 0;
			}
		}
		else if (pDisp->iItem == TID_CREATE_CON)
		{
			lstrcpyn(pDisp->pszText, _T("Create new console"), pDisp->cchTextMax);
		}
		else if (pDisp->iItem == TID_ALTERNATIVE)
		{
			bool lbChecked = mp_Rebar->GetToolBtnChecked(TID_ALTERNATIVE);
			lstrcpyn(pDisp->pszText,
			         lbChecked ? L"Alternative mode is ON (console freezed)" : L"Alternative mode is off",
			         pDisp->cchTextMax);
		}
		else if (pDisp->iItem == TID_SCROLL)
		{
			bool lbChecked = mp_Rebar->GetToolBtnChecked(TID_SCROLL);
			lstrcpyn(pDisp->pszText,
			         lbChecked ? L"BufferHeight mode is ON (scrolling enabled)" : L"BufferHeight mode is off",
			         pDisp->cchTextMax);
		}
		else if (pDisp->iItem == TID_MINIMIZE)
		{
			lstrcpyn(pDisp->pszText, _T("Minimize window"), pDisp->cchTextMax);
		}
		else if (pDisp->iItem == TID_MAXIMIZE)
		{
			lstrcpyn(pDisp->pszText, _T("Maximize window"), pDisp->cchTextMax);
		}
		else if (pDisp->iItem == TID_APPCLOSE)
		{
			lstrcpyn(pDisp->pszText, _T("Close ALL consoles"), pDisp->cchTextMax);
		}
		//else if (pDisp->iItem == TID_COPYING)
		//{
		//	lstrcpyn(pDisp->pszText, _T("Show copying queue"), pDisp->cchTextMax);
		//}
		else if (pDisp->iItem == TID_SYSMENU)
		{
			lstrcpyn(pDisp->pszText, _T("Show system menu (RClick for Settings)"), pDisp->cchTextMax);
		}
		else
		{
			_ASSERTE(FALSE && "Tooltip was not processed");
		}

		return true;
	}

	if (nmhdr->code == TBN_DROPDOWN && mp_Rebar->IsToolbarNotify(nmhdr))
	{
		LPNMTOOLBAR pBtn = (LPNMTOOLBAR)nmhdr;
		switch (pBtn->iItem)
		{
		case TID_ACTIVE_NUMBER:
			OnChooseTabPopup();
			break;
		case TID_CREATE_CON:
			gpConEmu->mp_Menu->OnNewConPopupMenu(NULL, 0, isPressed(VK_SHIFT));
			break;
		#ifdef _DEBUG
		default:
			_ASSERTE(FALSE && "DropDown was not processed");
//.........这里部分代码省略.........
开发者ID:negadj,项目名称:ConEmu,代码行数:101,代码来源:TabBar.cpp

示例10: OnInitDialog


//.........这里部分代码省略.........
		ShowWindow(GetDlgItem(hDlg, stRecreateSplit), SW_HIDE);
		ShowWindow(GetDlgItem(hDlg, tRecreateSplit), SW_HIDE);
	}
	else
	{
		// Fill splits
		SetDlgItemInt(hDlg, tRecreateSplit, (1000-pArgs->nSplitValue)/10, FALSE);
		CheckRadioButton(hDlg, rbRecreateSplitNone, rbRecreateSplit2Bottom, rbRecreateSplitNone+pArgs->eSplit);
		EnableWindow(GetDlgItem(hDlg, tRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
		EnableWindow(GetDlgItem(hDlg, stRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
	}

	// Спрятать флажок "New window"
	bool bRunInNewWindow_Hidden = (pArgs->aRecreate == cra_EditTab || pArgs->aRecreate == cra_RecreateTab);
	ShowWindow(GetDlgItem(hDlg, cbRunInNewWindow), bRunInNewWindow_Hidden ? SW_HIDE : SW_SHOWNORMAL);


	const wchar_t *pszUser = pArgs->pszUserName;
	const wchar_t *pszDomain = pArgs->pszDomain;
	bool bResticted = (pArgs->RunAsRestricted == crb_On);
	int nChecked = rbCurrentUser;
	int nNetOnly = cbRunAsNetOnly;
	DWORD nUserNameLen = countof(ms_CurUser);

	if (!GetUserName(ms_CurUser, &nUserNameLen))
		ms_CurUser[0] = 0;

	wchar_t szRbCaption[MAX_PATH*3];
	lstrcpy(szRbCaption, L"Run as current &user: "); lstrcat(szRbCaption, ms_CurUser);
	SetDlgItemText(hDlg, rbCurrentUser, szRbCaption);

	wchar_t szOtherUser[MAX_PATH*2+1]; szOtherUser[0] = 0;

	CVConGuard VCon;
	CVirtualConsole* pVCon = (gpConEmu->GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;
	EnableWindow(GetDlgItem(hDlg, cbRunAsNetOnly), FALSE);
	if ((pArgs->pszUserName && *pArgs->pszUserName)
		|| ((pArgs->aRecreate == cra_RecreateTab) && pVCon && pVCon->RCon()->GetUserPwd(&pszUser, &pszDomain, &bResticted)))
	{
		nChecked = rbAnotherUser;
		CheckDlgButton(hDlg, cbRunAsNetOnly, (pArgs->RunAsNetOnly == crb_On) ? BST_CHECKED : BST_UNCHECKED);
		if (bResticted)
		{
			CheckDlgButton(hDlg, cbRunAsRestricted, BST_CHECKED);
		}
		else
		{
			if (pArgs->pszUserName && *pArgs->pszUserName)
				lstrcpyn(szOtherUser, pArgs->pszUserName, countof(szOtherUser));
			else
				lstrcpyn(szOtherUser, ms_CurUser, countof(szOtherUser));

			if (pszDomain)
			{
				if (wcschr(pszDomain, L'.'))
				{
					// Если в имени домена есть точка - используем нотацию [email protected]
					// По идее, мы сюда не попадаем, т.к. при вводе имени в таком формате
					// pszDomain не заполняется, и "UPN format" остается в pszUser
					lstrcpyn(szOtherUser, pszUser, MAX_PATH);
					wcscat_c(szOtherUser, L"@");
					lstrcpyn(szOtherUser+_tcslen(szOtherUser), pszDomain, MAX_PATH);
				}
				else
				{
					// "Старая" нотация domain\user
开发者ID:davgit,项目名称:ConEmu,代码行数:67,代码来源:Recreate.cpp

示例11: RecreateDlgProc


//.........这里部分代码省略.........
				ShowWindow(GetDlgItem(hDlg, rbRecreateSplit2Right), SW_HIDE);
				ShowWindow(GetDlgItem(hDlg, rbRecreateSplit2Bottom), SW_HIDE);
				ShowWindow(GetDlgItem(hDlg, stRecreateSplit), SW_HIDE);
				ShowWindow(GetDlgItem(hDlg, tRecreateSplit), SW_HIDE);
			}
			else
			{
				// Fill splits
				SetDlgItemInt(hDlg, tRecreateSplit, (1000-pArgs->nSplitValue)/10, FALSE);
				CheckRadioButton(hDlg, rbRecreateSplitNone, rbRecreateSplit2Bottom, rbRecreateSplitNone+pArgs->eSplit);
				EnableWindow(GetDlgItem(hDlg, tRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
				EnableWindow(GetDlgItem(hDlg, stRecreateSplit), (pArgs->eSplit != pArgs->eSplitNone));
			}

			// Спрятать флажок "New window"
			bool bRunInNewWindow_Hidden = (pArgs->aRecreate == cra_EditTab || pArgs->aRecreate == cra_RecreateTab);
			ShowWindow(GetDlgItem(hDlg, cbRunInNewWindow), bRunInNewWindow_Hidden ? SW_HIDE : SW_SHOWNORMAL);


			const wchar_t *pszUser = pArgs->pszUserName;
			const wchar_t *pszDomain = pArgs->pszDomain;
			bool bResticted = (pArgs->RunAsRestricted == crb_On);
			int nChecked = rbCurrentUser;
			DWORD nUserNameLen = countof(pDlg->ms_CurUser);

			if (!GetUserName(pDlg->ms_CurUser, &nUserNameLen)) pDlg->ms_CurUser[0] = 0;

			wchar_t szRbCaption[MAX_PATH*3];
			lstrcpy(szRbCaption, L"Run as current &user: "); lstrcat(szRbCaption, pDlg->ms_CurUser);
			SetDlgItemText(hDlg, rbCurrentUser, szRbCaption);

			wchar_t szOtherUser[MAX_PATH*2+1]; szOtherUser[0] = 0;

			CVConGuard VCon;
			CVirtualConsole* pVCon = (gpConEmu->GetActiveVCon(&VCon) >= 0) ? VCon.VCon() : NULL;

			if ((pArgs->pszUserName && *pArgs->pszUserName)
				|| ((pArgs->aRecreate == cra_RecreateTab) && pVCon && pVCon->RCon()->GetUserPwd(&pszUser, &pszDomain, &bResticted)))
			{
				nChecked = rbAnotherUser;

				if (bResticted)
				{
					CheckDlgButton(hDlg, cbRunAsRestricted, BST_CHECKED);
				}
				else
				{
					if (pArgs->pszUserName && *pArgs->pszUserName)
						lstrcpyn(szOtherUser, pArgs->pszUserName, countof(szOtherUser));
					else
						lstrcpyn(szOtherUser, pDlg->ms_CurUser, countof(szOtherUser));

					if (pszDomain)
					{
						if (wcschr(pszDomain, L'.'))
						{
							// Если в имени домена есть точка - используем нотацию [email protected]
							// По идее, мы сюда не попадаем, т.к. при вводе имени в таком формате
							// pszDomain не заполняется, и "UPN format" остается в pszUser
							lstrcpyn(szOtherUser, pszUser, MAX_PATH);
							wcscat_c(szOtherUser, L"@");
							lstrcpyn(szOtherUser+_tcslen(szOtherUser), pszDomain, MAX_PATH);
						}
						else
						{
							// "Старая" нотация domain\user
开发者ID:rheostat2718,项目名称:conemu-maximus5,代码行数:67,代码来源:Recreate.cpp

示例12: BackWndProc

LRESULT CConEmuChild::BackWndProc(HWND hWnd, UINT messg, WPARAM wParam, LPARAM lParam)
{
	LRESULT result = 0;

	// Logger
	MSG msgStr = {hWnd, messg, wParam, lParam};
	ConEmuMsgLogger::Log(msgStr, ConEmuMsgLogger::msgBack);

	if (gpSetCls->isAdvLogging >= 4)
	{
		gpConEmu->LogMessage(hWnd, messg, wParam, lParam);
	}

	CVConGuard guard;
	CVirtualConsole* pVCon = NULL;
	if (messg == WM_CREATE || messg == WM_NCCREATE)
	{
		LPCREATESTRUCT lp = (LPCREATESTRUCT)lParam;
		guard = (CVirtualConsole*)lp->lpCreateParams;
		pVCon = guard.VCon();
		if (pVCon)
			gVConBkMap.Set(hWnd, pVCon);
	}
	else if (hWnd != ghBkInDestroing)
	{
		if (!gVConBkMap.Get(hWnd, &pVCon) || !guard.Attach(pVCon))
			pVCon = NULL;
	}

	if (messg == WM_SYSCHAR)
	{
		_ASSERTE(FALSE); // по идее, фокуса тут быть не должно
		// Чтобы не пищало
		result = TRUE;
		goto wrap;
	}

	if (!pVCon)
	{
		_ASSERTE(pVCon!=NULL || hWnd==ghBkInDestroing);
		result = DefWindowProc(hWnd, messg, wParam, lParam);
		goto wrap;
	}

	switch (messg)
	{
	case WM_SHOWWINDOW:
			if (wParam)
			{
				HWND hView = pVCon->GetView();
				SetWindowPos(hView, HWND_TOP, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
				SetWindowPos(hWnd, hView, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
			}
			break; // DefaultProc
		case WM_SETFOCUS:
			// Если в консоли работает "GUI" окно (GUI режим), то фокус нужно отдать туда.
			{
				// Фокус должен быть в главном окне! За исключением случая работы в GUI режиме.
				pVCon->setFocus();
			}
			return 0;
		case WM_ERASEBKGND:
			result = 0;
			break;
		case WM_PAINT:
			_ASSERTE(hWnd == pVCon->mh_WndBack);
			pVCon->OnPaintGaps();
			break;
		case WM_KEYDOWN:
		case WM_KEYUP:
		case WM_SYSKEYDOWN:
		case WM_SYSKEYUP:
		case WM_MOUSEWHEEL:
		case WM_ACTIVATE:
		case WM_ACTIVATEAPP:
			//case WM_MOUSEACTIVATE:
		case WM_KILLFOCUS:
			//case WM_SETFOCUS:
		case WM_MOUSEMOVE:
		case WM_RBUTTONDOWN:
		case WM_RBUTTONUP:
		case WM_MBUTTONDOWN:
		case WM_MBUTTONUP:
		case WM_LBUTTONDOWN:
		case WM_LBUTTONUP:
		case WM_LBUTTONDBLCLK:
		case WM_MBUTTONDBLCLK:
		case WM_RBUTTONDBLCLK:
		case WM_XBUTTONDOWN:
		case WM_XBUTTONUP:
		case WM_XBUTTONDBLCLK:
		case WM_VSCROLL:
			// Вся обработка в родителе
			{
				switch (messg)
				{
					case WM_VSCROLL:
						switch (LOWORD(wParam))
						{
						case SB_THUMBTRACK:
//.........这里部分代码省略.........
开发者ID:havocbane,项目名称:ConEmu,代码行数:101,代码来源:VConChild.cpp

示例13: ChildWndProc

LRESULT CConEmuChild::ChildWndProc(HWND hWnd, UINT messg, WPARAM wParam, LPARAM lParam)
{
	LRESULT result = 0;

	// Logger
	MSG msgStr = {hWnd, messg, wParam, lParam};
	ConEmuMsgLogger::Log(msgStr, ConEmuMsgLogger::msgCanvas);

	if (gpSetCls->isAdvLogging >= 4)
	{
		gpConEmu->LogMessage(hWnd, messg, wParam, lParam);
	}

	CVConGuard guard;
	CVirtualConsole* pVCon = NULL;
	if (messg == WM_CREATE || messg == WM_NCCREATE)
	{
		LPCREATESTRUCT lp = (LPCREATESTRUCT)lParam;
		guard = (CVirtualConsole*)lp->lpCreateParams;
		pVCon = guard.VCon();
		if (pVCon)
		{
			gVConDcMap.Set(hWnd, pVCon);

			pVCon->m_TAutoCopy.Init(hWnd, TIMER_AUTOCOPY, TIMER_AUTOCOPY_DELAY);

			pVCon->m_TScrollShow.Init(hWnd, TIMER_SCROLL_SHOW, TIMER_SCROLL_SHOW_DELAY);
			pVCon->m_TScrollHide.Init(hWnd, TIMER_SCROLL_HIDE, TIMER_SCROLL_HIDE_DELAY);
			#ifndef SKIP_HIDE_TIMER
			pVCon->m_TScrollCheck.Init(hWnd, TIMER_SCROLL_CHECK, TIMER_SCROLL_CHECK_DELAY);
			#endif
		}
	}
	else if (hWnd != ghDcInDestroing)
	{
		if (!gVConDcMap.Get(hWnd, &pVCon) || !guard.Attach(pVCon))
			pVCon = NULL;
	}


	if (messg == WM_SYSCHAR)
	{
		_ASSERTE(FALSE); // по идее, фокуса тут быть не должно
		// Чтобы не пищало
		result = TRUE;
		goto wrap;
	}

	if (!pVCon)
	{
		_ASSERTE(pVCon!=NULL || hWnd==ghDcInDestroing);
		result = DefWindowProc(hWnd, messg, wParam, lParam);
		goto wrap;
	}

	switch (messg)
	{
		case WM_SHOWWINDOW:
			{
				#ifdef _DEBUG
				HWND hGui = pVCon->GuiWnd();
				if (hGui)
				{
					_ASSERTE(((wParam==0) || pVCon->RCon()->isGuiForceConView()) && "Show DC while GuiWnd exists");
				}
				#endif
				result = DefWindowProc(hWnd, messg, wParam, lParam);
				break;
			}
		case WM_SETFOCUS:
			// Если в консоли работает "GUI" окно (GUI режим), то фокус нужно отдать туда.
			{
				// Фокус должен быть в главном окне! За исключением случая работы в GUI режиме.
				pVCon->setFocus();
			}
			return 0;
		case WM_ERASEBKGND:
			result = 0;
			break;
		case WM_PAINT:
			result = pVCon->OnPaint();
			break;
		case WM_PRINTCLIENT:
			if (wParam && (lParam & PRF_CLIENT))
			{
				pVCon->PrintClient((HDC)wParam, false, NULL);
			}
			break;
		case WM_SIZE:
			#ifdef _DEBUG
			{
				RECT rc; GetClientRect(hWnd, &rc);
				short cx = LOWORD(lParam);
				rc.left = rc.left;
			}
			#endif
			result = pVCon->OnSize(wParam, lParam);
			break;
		case WM_MOVE:
			result = pVCon->OnMove(wParam, lParam);
//.........这里部分代码省略.........
开发者ID:havocbane,项目名称:ConEmu,代码行数:101,代码来源:VConChild.cpp

示例14: Update

void CTabBarClass::Update(BOOL abPosted/*=FALSE*/)
{
	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif

	MCHKHEAP
	/*if (!_active)
	{
	    return;
	}*/ // Теперь - ВСЕГДА! т.к. сами управляем мультиконсолью

	if (mb_DisableRedraw)
	{
		_ASSERTE(FALSE && "mb_DisableRedraw?"); // Надо?
		return;
	}

	if (!isMainThread())
	{
		RequestPostUpdate();
		return;
	}

	gpConEmu->mp_Status->UpdateStatusBar();

	mb_PostUpdateCalled = FALSE;

	#ifdef _DEBUG
	_ASSERTE(mn_InUpdate >= 0);
	if (mn_InUpdate > 0)
	{
		_ASSERTE(mn_InUpdate == 0);
	}
	#endif

	mn_InUpdate ++;

	MCHKHEAP
	int V, I, tabIdx = 0, nCurTab = -1;
	BOOL bShowFarWindows = gpSet->bShowFarWindows;

	// Выполняться должно только в основной нити, так что CriticalSection не нужна

	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif

	TODO("Обработка gpSet->bHideInactiveConsoleTabs для новых табов");
	MCHKHEAP


	// Check if we need to AutoSHOW or AutoHIDE tab bar
	if (!IsTabsActive() && gpSet->isTabs)
	{
		int nTabs = CountActiveTabs(2);
		if (nTabs > 1)
		{
			Activate();
		}
	}
	else if (IsTabsActive() && gpSet->isTabs==2)
	{
		int nTabs = CountActiveTabs(2);
		if (nTabs <= 1)
		{
			Deactivate();
		}
	}


	// Validation?
	#ifdef _DEBUG
	if (this != gpConEmu->mp_TabBar)
	{
		_ASSERTE(this == gpConEmu->mp_TabBar);
	}
	#endif



	MCHKHEAP
	HANDLE hUpdate = m_Tabs.UpdateBegin();
	_ASSERTE(hUpdate!=NULL);

	bool bStackChanged = false;

	/* ********************* */
	/*          Go           */
	/* ********************* */
	{
		MMap<CVConGroup*,CVirtualConsole*> Groups; Groups.Init(MAX_CONSOLE_COUNT, true);

		for (V = 0; V < MAX_CONSOLE_COUNT; V++)
//.........这里部分代码省略.........
开发者ID:negadj,项目名称:ConEmu,代码行数:101,代码来源:TabBar.cpp

示例15: ProcessRunQueue

void CRunQueue::ProcessRunQueue(bool bFromPostMessage)
{
	// Previous execution was not finished yet?
	if (mb_InExecution)
	{
		if (!m_RunQueue.empty())
		{
			// Ensure timer is ON
			gpConEmu->SetRunQueueTimer(true, RUNQUEUE_TIMER_DELAY);
		}

		// Skip this timer
		return;
	}

	if (bFromPostMessage)
	{
		mb_PostRequested = false;
	}
	else if (RUNQUEUE_DELAY_LIMIT > 0)
	{
		// This is from WM_TIMER, check delay (if not first call)
		if (mn_LastExecutionTick != 0)
		{
			DWORD nCurDelay = (GetTickCount() - mn_LastExecutionTick);

			if (nCurDelay < RUNQUEUE_DELAY_LIMIT)
			{
				// Timeout was not passed till last execution

				if (!m_RunQueue.empty())
				{
					// Ensure timer is ON
					gpConEmu->SetRunQueueTimer(true, RUNQUEUE_TIMER_DELAY);
				}

				return;
			}
		}
	}

	_ASSERTE(gpConEmu->isMainThread() == true);

	if (CVConGroup::InCreateGroup())
	{
		if (!m_RunQueue.empty())
		{
			// Ensure timer is ON
			gpConEmu->SetRunQueueTimer(true, RUNQUEUE_TIMER_DELAY);
		}

		return;
	}

	CVConGuard VCon;

	EnterCriticalSection(&mcs_QueueLock);
	// Nothing to run?
	if (m_RunQueue.empty())
	{
		gpConEmu->SetRunQueueTimer(false, 0);
	}
	else
	{
		while (!m_RunQueue.empty())
		{
			RunQueueItem item = m_RunQueue[0];
			m_RunQueue.erase(0);

			if (gpConEmu->isValid(item.pVCon))
			{
				VCon = item.pVCon;
				break;
			}
		}
	}
	LeaveCriticalSection(&mcs_QueueLock);


	// Queue is empty now?
	if (VCon.VCon())
	{
		mb_InExecution = true;
		bool bOpt = gpConEmu->ExecuteProcessPrepare();

		VCon->RCon()->OnStartProcessAllowed();

		gpConEmu->ExecuteProcessFinished(bOpt);
		mb_InExecution = false;

		// Remember last execution moment
		mn_LastExecutionTick = GetTickCount();
	}
	else
	{
		#ifdef _DEBUG
		if (!m_RunQueue.empty())
		{
			_ASSERTE(m_RunQueue.empty());
		}
//.........这里部分代码省略.........
开发者ID:mirror,项目名称:conemu,代码行数:101,代码来源:RunQueue.cpp


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