本文整理汇总了C++中CVConGuard::RCon方法的典型用法代码示例。如果您正苦于以下问题:C++ CVConGuard::RCon方法的具体用法?C++ CVConGuard::RCon怎么用?C++ CVConGuard::RCon使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVConGuard
的用法示例。
在下文中一共展示了CVConGuard::RCon方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInfo_ThrowTrapException
void ConEmuAbout::OnInfo_ThrowTrapException(bool bMainThread)
{
if (bMainThread)
{
if (MsgBox(L"Are you sure?\nApplication will terminates after that!\nThrow exception in ConEmu's main thread?", MB_ICONEXCLAMATION|MB_YESNO|MB_DEFBUTTON2)==IDYES)
{
//#ifdef _DEBUG
//MyAssertTrap();
//#else
//DebugBreak();
//#endif
// -- trigger division by 0
RaiseTestException();
}
}
else
{
if (MsgBox(L"Are you sure?\nApplication will terminates after that!\nThrow exception in ConEmu's monitor thread?", MB_ICONEXCLAMATION|MB_YESNO|MB_DEFBUTTON2)==IDYES)
{
CVConGuard VCon;
if ((gpConEmu->GetActiveVCon(&VCon) >= 0) && VCon->RCon())
VCon->RCon()->MonitorAssertTrap();
}
}
}
示例2: FindTextDialog
void CEFindDlg::FindTextDialog()
{
if (mh_FindDlg && IsWindow(mh_FindDlg))
{
SetForegroundWindow(mh_FindDlg);
return;
}
CVConGuard VCon;
CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL;
// Создаем диалог поиска только для консольных приложений
if (!pRCon || (pRCon->GuiWnd() && !pRCon->isBufferHeight()) || !pRCon->GetView())
{
//DisplayLastError(L"No RealConsole, nothing to find");
return;
}
gpConEmu->SkipOneAppsRelease(true);
mh_FindDlg = CreateDialogParam((HINSTANCE)GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_FIND), ghWnd, findTextProc, 0/*Param*/);
if (!mh_FindDlg)
{
DisplayLastError(L"Can't create Find text dialog", GetLastError());
}
}
示例3: 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);
}
示例4: ProcessMove
// This function is called throughout the duration of the panning/inertia gesture
bool CGestures::ProcessMove(HWND hWnd, const LONG ldx, const LONG ldy)
{
bool lbSent = false;
if (ldy)
{
CVConGuard VCon;
CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL;
if (pRCon)
{
TODO("Если можно будет задавать разный шрифт для разных консолей - заменить gpSet->FontSizeY");
// Соотнести Pan с высотой шрифта
int dy = ((ldy < 0) ? -ldy : ldy) / gpSet->FontSizeY;
if (dy > 0)
{
short Delta = ((ldy < 0) ? -120 : 120) * dy;
#ifdef _DEBUG
wchar_t szDbg[128]; _wsprintf(szDbg, SKIPLEN(countof(szDbg)) L" ProcessMove(%i,%i), WheelDelta=%i\n", ldx, ldy, (int)Delta);
DEBUGSTRPAN(szDbg);
#endif
POINT pt = _ptBegin;
if (hWnd != VCon->GetView())
MapWindowPoints(hWnd, VCon->GetView(), &pt, 1);
pRCon->OnMouse(WM_MOUSEWHEEL, MAKELPARAM(0,Delta), pt.x, pt.y, true, true);
lbSent = true; // Запомнить обработанную координату
}
}
}
return lbSent;
}
示例5: InsideUpdateDir
void CConEmuInside::InsideUpdateDir()
{
CVConGuard VCon;
if (mh_InsideParentPath && IsWindow(mh_InsideParentPath) && (gpConEmu->GetActiveVCon(&VCon) >= 0) && VCon->RCon())
{
wchar_t szCurText[512] = {};
DWORD_PTR lRc = 0;
if (SendMessageTimeout(mh_InsideParentPath, WM_GETTEXT, countof(szCurText), (LPARAM)szCurText, SMTO_ABORTIFHUNG|SMTO_NORMAL, 300, &lRc))
{
if (gnOsVer < 0x600)
{
// Если в заголовке нет полного пути
if (wcschr(szCurText, L'\\') == NULL)
{
// Сразу выходим
return;
}
}
LPCWSTR pszPath = NULL;
// Если тут уже путь - то префикс не отрезать
if ((szCurText[0] == L'\\' && szCurText[1] == L'\\' && szCurText[2]) // сетевой путь
|| (szCurText[0] && szCurText[1] == L':' && szCurText[2] == L'\\' /*&& szCurText[3]*/)) // Путь через букву диска
{
pszPath = szCurText;
}
else
{
// Иначе - отрезать префикс. На английской винде это "Address: D:\dir1\dir2"
pszPath = wcschr(szCurText, L':');
if (pszPath)
pszPath = SkipNonPrintable(pszPath+1);
}
// Если успешно - сравниваем с ms_InsideParentPath
if (pszPath && *pszPath && (lstrcmpi(ms_InsideParentPath, pszPath) != 0))
{
int nLen = lstrlen(pszPath);
if (nLen >= (int)countof(ms_InsideParentPath))
{
_ASSERTE((nLen<countof(ms_InsideParentPath)) && "Too long path?");
}
else //if (VCon->RCon())
{
// Запомнить для сравнения
lstrcpyn(ms_InsideParentPath, pszPath, countof(ms_InsideParentPath));
// Подготовить команду для выполнения в Shell
VCon->RCon()->PostPromptCmd(true, pszPath);
}
}
}
}
}
示例6: DoEndFindText
void CConEmuCtrl::DoEndFindText(CRealConsole* pRCon /*= NULL*/)
{
CVConGuard VCon;
if (!pRCon)
{
pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL;
if (!pRCon)
return;
}
pRCon->DoEndFindText();
}
示例7: SendRClick
void CGestures::SendRClick(HWND hWnd, const LONG ldx, const LONG ldy)
{
CVConGuard VCon;
CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL;
if (pRCon)
{
POINT pt = {ldx, ldy};
if (hWnd != VCon->GetView())
MapWindowPoints(hWnd, VCon->GetView(), &pt, 1);
pRCon->OnMouse(WM_RBUTTONDOWN, MK_RBUTTON, pt.x, pt.y);
pRCon->OnMouse(WM_RBUTTONUP, 0, pt.x, pt.y);
}
}
示例8: CanActivateTab
bool CTabBarClass::CanActivateTab(int nTabIdx)
{
CVConGuard VCon;
DWORD wndIndex = 0;
if (!GetVConFromTab(nTabIdx, &VCon, &wndIndex))
return false;
if (!VCon->RCon()->CanActivateFarWindow(wndIndex))
return false;
return true;
}
示例9: key_ChildSystemMenu
bool CConEmuCtrl::key_ChildSystemMenu(const ConEmuChord& VkState, bool TestOnly, const ConEmuHotKey* hk, CRealConsole* pRCon)
{
if (TestOnly)
return true;
// Должно обрабатываться через WM_HOTKEY
CVConGuard VCon;
if (gpConEmu->GetActiveVCon(&VCon) >= 0)
{
VCon->RCon()->ChildSystemMenu();
}
return true;
}
示例10: GetOpenedPanels
size_t CConEmuCtrl::GetOpenedPanels(wchar_t*& pszDirs, int& iCount, int& iCurrent)
{
CmdArg szActiveDir, szPassive;
CVConGuard VCon;
MArray<wchar_t*> Dirs;
size_t cchAllLen = 1;
iCount = iCurrent = 0;
for (int V = 0; CVConGroup::GetVCon(V, &VCon, true); V++)
{
VCon->RCon()->GetPanelDirs(szActiveDir, szPassive);
if (VCon->isActive(false))
iCurrent = iCount;
LPCWSTR psz[] = {szActiveDir.ms_Arg, szPassive.ms_Arg};
for (int i = 0; i <= 1; i++)
{
if (psz[i] && psz[i][0])
{
int iLen = lstrlen(psz[i]);
cchAllLen += (iLen+1);
Dirs.push_back(lstrdup(psz[i]));
iCount++;
}
}
}
_ASSERTE(pszDirs == NULL);
pszDirs = (wchar_t*)malloc(cchAllLen*sizeof(*pszDirs));
if (!pszDirs)
return 0;
wchar_t* psz = pszDirs;
for (int i = 0; i < Dirs.size(); i++)
{
wchar_t* p = Dirs[i];
_wcscpy_c(psz, cchAllLen, p);
psz += lstrlen(psz)+1;
free(p);
}
return cchAllLen;
}
示例11: ColorCtlStatic
INT_PTR CSetDlgColors::ColorCtlStatic(HWND hWnd2, WORD c, HWND hItem)
{
if (GetDlgItem(hWnd2, c) == hItem)
{
if (mh_CtlColorBrush) DeleteObject(mh_CtlColorBrush);
COLORREF cr = 0;
if (c >= c32 && c <= c34)
{
ThumbColor *ptc = NULL;
if (c == c32) ptc = &gpSet->ThSet.crBackground;
else if (c == c33) ptc = &gpSet->ThSet.crPreviewFrame;
else ptc = &gpSet->ThSet.crSelectFrame;
//
if (ptc->UseIndex)
{
if (ptc->ColorIdx >= 0 && ptc->ColorIdx <= 15)
{
cr = gpSet->Colors[ptc->ColorIdx];
}
else
{
CVConGuard VCon;
const CEFAR_INFO_MAPPING *pfi = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon()->GetFarInfo() : NULL;
if (pfi && pfi->cbSize>=sizeof(CEFAR_INFO_MAPPING))
{
cr = gpSet->Colors[(pfi->nFarColors[col_PanelText] & 0xF0)>>4];
}
else
{
cr = gpSet->Colors[1];
}
}
}
示例12: FindTextDialog
void CEFindDlg::FindTextDialog()
{
if (mh_FindDlg && IsWindow(mh_FindDlg))
{
SetForegroundWindow(mh_FindDlg);
return;
}
CVConGuard VCon;
CRealConsole* pRCon = (CVConGroup::GetActiveVCon(&VCon) >= 0) ? VCon->RCon() : NULL;
// Создаем диалог поиска только для консольных приложений
if (!pRCon || (pRCon->GuiWnd() && !pRCon->isBufferHeight()) || !pRCon->GetView())
{
//DisplayLastError(L"No RealConsole, nothing to find");
return;
}
if (gpConEmu->mp_TabBar && gpConEmu->mp_TabBar->ActivateSearchPane(true))
{
// Контрол поиска встроен и показан в панели инструментов
return;
}
gpConEmu->SkipOneAppsRelease(true);
if (!mp_DpiAware)
mp_DpiAware = new CDpiForDialog();
// (CreateDialog)
mp_Dlg = CDynDialog::ShowDialog(IDD_FIND, ghWnd, findTextProc, 0/*Param*/);
mh_FindDlg = mp_Dlg ? mp_Dlg->mh_Dlg : NULL;
if (!mh_FindDlg)
{
DisplayLastError(L"Can't create Find text dialog", GetLastError());
}
}
示例13: 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");
//.........这里部分代码省略.........
示例14: GuiServerCommand
//// Эта функция пайп не закрывает!
//void CGuiServer::GuiServerThreadCommand(HANDLE hPipe)
BOOL CGuiServer::GuiServerCommand(LPVOID pInst, CESERVER_REQ* pIn, CESERVER_REQ* &ppReply, DWORD &pcbReplySize, DWORD &pcbMaxReplySize, LPARAM lParam)
{
BOOL lbRc = FALSE;
CGuiServer* pGSrv = (CGuiServer*)lParam;
if (!pGSrv)
{
_ASSERTE(((CGuiServer*)lParam)!=NULL);
pGSrv = &gpConEmu->m_GuiServer;
}
if (pIn->hdr.bAsync)
pGSrv->mp_GuiServer->BreakConnection(pInst);
gpSetCls->debugLogCommand(pIn, TRUE, timeGetTime(), 0, pGSrv ? pGSrv->ms_ServerPipe : NULL);
#ifdef _DEBUG
UINT nDataSize = pIn->hdr.cbSize - sizeof(CESERVER_REQ_HDR);
#endif
// Все данные из пайпа получены, обрабатываем команду и возвращаем (если нужно) результат
#ifdef ALLOW_WINE_MSG
if (gbIsWine)
{
wchar_t szMsg[128];
msprintf(szMsg, countof(szMsg), L"CGuiServer::GuiServerCommand.\nGUI TID=%u\nSrcPID=%u, SrcTID=%u, Cmd=%u",
GetCurrentThreadId(), pIn->hdr.nSrcPID, pIn->hdr.nSrcThreadId, pIn->hdr.nCmd);
MessageBox(szMsg, MB_ICONINFORMATION);
}
#endif
switch (pIn->hdr.nCmd)
{
case CECMD_NEWCMD:
{
// Приходит из другой копии ConEmu.exe, когда она запущена с ключом /single, /showhide, /showhideTSA
DEBUGSTRCMD(L"GUI recieved CECMD_NEWCMD\n");
LPCWSTR pszCommand = pIn->NewCmd.GetCommand();
_ASSERTE(pszCommand!=NULL && "Must be at least empty string but NOT NULL");
if (pIn->NewCmd.isAdvLogging && !gpSetCls->isAdvLogging)
{
gpSetCls->isAdvLogging = pIn->NewCmd.isAdvLogging;
gpConEmu->CreateLog();
}
if (gpSetCls->isAdvLogging && (pIn->NewCmd.isAdvLogging > gpSetCls->isAdvLogging))
{
wchar_t szLogLevel[80];
_wsprintf(szLogLevel, SKIPLEN(countof(szLogLevel)) L"Changing log level! Old=%u, New=%u", (UINT)gpSetCls->isAdvLogging, (UINT)pIn->NewCmd.isAdvLogging);
gpConEmu->LogString(szLogLevel);
gpSetCls->isAdvLogging = pIn->NewCmd.isAdvLogging;
}
if (gpSetCls->isAdvLogging)
{
size_t cchAll = 120 + _tcslen(pIn->NewCmd.szConEmu) + _tcslen(pIn->NewCmd.szCurDir) + _tcslen(pszCommand);
wchar_t* pszInfo = (wchar_t*)malloc(cchAll*sizeof(*pszInfo));
if (pszInfo)
{
_wsprintf(pszInfo, SKIPLEN(cchAll) L"CECMD_NEWCMD: Wnd=x%08X, Act=%u, ConEmu=%s, Dir=%s, Cmd=%s",
(DWORD)(DWORD_PTR)pIn->NewCmd.hFromConWnd, pIn->NewCmd.ShowHide,
pIn->NewCmd.szConEmu, pIn->NewCmd.szCurDir, pszCommand);
gpConEmu->LogString(pszInfo);
free(pszInfo);
}
}
BOOL bAccepted = FALSE;
if (pIn->NewCmd.szConEmu[0])
{
bAccepted = (lstrcmpi(gpConEmu->ms_ConEmuExeDir, pIn->NewCmd.szConEmu) == 0);
}
else
{
bAccepted = TRUE;
}
if (bAccepted)
{
bool bCreateTab = (pIn->NewCmd.ShowHide == sih_None || pIn->NewCmd.ShowHide == sih_StartDetached)
// Issue 1275: When minimized into TSA (on all VCon are closed) we need to restore and run new tab
|| (pszCommand[0] && !CVConGroup::isVConExists(0));
RConStartArgs rTest;
if (pszCommand[0])
{
rTest.pszSpecialCmd = lstrdup(pszCommand);
rTest.ProcessNewConArg();
}
bool bSkipActivation = false;
// Может быть пусто
if (bCreateTab && pszCommand[0])
{
//.........这里部分代码省略.........
示例15: GetOpenedTabs
size_t CConEmuCtrl::GetOpenedTabs(CESERVER_REQ_GETALLTABS::TabInfo*& pTabs)
{
_ASSERTE(pTabs==NULL);
int nConCount = gpConEmu->GetConCount();
int nActiveCon = gpConEmu->ActiveConNum();
size_t cchMax = nConCount*16;
size_t cchCount = 0;
CVConGuard VCon;
pTabs = (CESERVER_REQ_GETALLTABS::TabInfo*)calloc(cchMax, sizeof(*pTabs));
for (int V = 0; CVConGroup::GetVCon(V, &VCon, true); V++)
{
if (!pTabs)
{
_ASSERTE(pTabs!=NULL);
break;
}
CRealConsole* pRCon = VCon->RCon();
if (!pRCon)
continue;
CTab tab(__FILE__,__LINE__);
wchar_t szMark[6];
for (int t = 0; pRCon->GetTab(t, tab); t++)
{
int T = t; //tab->Info.nFarWindowID; -- В Far3 номер из nFarWindowID стал бесполезным для пользователя
if (cchCount >= cchMax)
{
pTabs = (CESERVER_REQ_GETALLTABS::TabInfo*)realloc(pTabs, (cchMax+32)*sizeof(*pTabs));
if (!pTabs)
{
_ASSERTE(pTabs!=NULL);
break;
}
cchMax += 32;
_ASSERTE(cchCount<cchMax);
}
pTabs[cchCount].ActiveConsole = (V == nActiveCon);
pTabs[cchCount].ActiveTab = ((tab->Flags() & fwt_CurrentFarWnd) == fwt_CurrentFarWnd);
pTabs[cchCount].Disabled = ((tab->Flags() & fwt_Disabled) == fwt_Disabled);
pTabs[cchCount].ConsoleIdx = V;
pTabs[cchCount].TabNo = T;
pTabs[cchCount].FarWindow = tab->Info.nFarWindowID;
// Text
//wcscpy_c(szMark, tab.Modified ? L" * " : L" ");
switch (tab->Type())
{
case fwt_Editor:
wcscpy_c(szMark, (tab->Flags() & fwt_ModifiedFarWnd) ? L" * " : L" E "); break;
case fwt_Viewer:
wcscpy_c(szMark, L" V "); break;
default:
wcscpy_c(szMark, L" ");
}
if ((V == nActiveCon) && (T <= 9))
_wsprintf(pTabs[cchCount].Title, SKIPLEN(countof(pTabs[cchCount].Title)) L"[%i/&%i]%s", V+1, T, szMark);
else
_wsprintf(pTabs[cchCount].Title, SKIPLEN(countof(pTabs[cchCount].Title)) L"[%i/%i]%s", V+1, T, szMark);
#ifdef _DEBUG
if (pRCon->IsFarLua())
_wsprintf(pTabs[cchCount].Title+lstrlen(pTabs[cchCount].Title), SKIPLEN(30) L"{%i} ", tab->Info.nFarWindowID);
#endif
int nCurLen = lstrlen(pTabs[cchCount].Title);
lstrcpyn(pTabs[cchCount].Title+nCurLen, pRCon->GetTabTitle(tab), countof(pTabs[cchCount].Title)-nCurLen);
cchCount++;
}
}
return cchCount;
}