本文整理汇总了C++中CVirtualConsole::GuiWnd方法的典型用法代码示例。如果您正苦于以下问题:C++ CVirtualConsole::GuiWnd方法的具体用法?C++ CVirtualConsole::GuiWnd怎么用?C++ CVirtualConsole::GuiWnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CVirtualConsole
的用法示例。
在下文中一共展示了CVirtualConsole::GuiWnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShowView
BOOL CConEmuChild::ShowView(int nShowCmd)
{
if (!this || !mh_WndDC)
return FALSE;
BOOL bRc = FALSE;
DWORD nTID = 0, nPID = 0;
wchar_t sInfo[200];
// Должно быть создано в главной нити!
nTID = GetWindowThreadProcessId(mh_WndDC, &nPID);
#ifdef _DEBUG
DWORD nMainThreadID = GetWindowThreadProcessId(ghWnd, &nPID);
_ASSERTE(nTID==nMainThreadID);
#endif
// Если это "GUI" режим - могут возникать блокировки из-за дочернего окна
CVirtualConsole* pVCon = (CVirtualConsole*)this;
_ASSERTE(pVCon!=NULL);
CVConGuard guard(pVCon);
HWND hChildGUI = pVCon->GuiWnd();
BOOL bGuiVisible = (hChildGUI && nShowCmd) ? pVCon->RCon()->isGuiVisible() : FALSE;
if (gpSetCls->isAdvLogging)
{
if (hChildGUI != NULL)
_wsprintf(sInfo, SKIPLEN(countof(sInfo)) L"ShowView: Back=x%08X, DC=x%08X, ChildGUI=x%08X, ShowCMD=%u, ChildVisible=%u",
(DWORD)mh_WndBack, (DWORD)mh_WndDC, (DWORD)hChildGUI, nShowCmd, bGuiVisible);
else
_wsprintf(sInfo, SKIPLEN(countof(sInfo)) L"ShowView: Back=x%08X, DC=x%08X, ShowCMD=%u",
(DWORD)mh_WndBack, (DWORD)mh_WndDC, nShowCmd);
gpConEmu->LogString(sInfo);
}
if ((GetCurrentThreadId() != nTID) || (hChildGUI != NULL))
{
bRc = ShowWindowAsync(mh_WndBack, nShowCmd);
bRc = ShowWindowAsync(mh_WndDC, bGuiVisible ? SW_HIDE : nShowCmd);
}
else
{
bRc = ShowWindow(mh_WndBack, nShowCmd);
bRc = ShowWindow(mh_WndDC, nShowCmd);
if (nShowCmd)
{
SetWindowPos(mh_WndDC, HWND_TOP, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
SetWindowPos(mh_WndBack, mh_WndDC, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
}
}
return bRc;
}
示例2: 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);
//.........这里部分代码省略.........
示例3: ShowView
BOOL CConEmuChild::ShowView(int nShowCmd)
{
if (!this || !mh_WndDC)
return FALSE;
BOOL bRc = FALSE;
DWORD nTID = 0, nPID = 0;
wchar_t sInfo[200];
// Должно быть создано в главной нити!
nTID = GetWindowThreadProcessId(mh_WndDC, &nPID);
#ifdef _DEBUG
DWORD nMainThreadID = GetWindowThreadProcessId(ghWnd, &nPID);
_ASSERTE(nTID==nMainThreadID);
#endif
// Если это "GUI" режим - могут возникать блокировки из-за дочернего окна
CVirtualConsole* pVCon = mp_VCon;
_ASSERTE(pVCon!=NULL);
CVConGuard guard(pVCon);
HWND hChildGUI = pVCon->GuiWnd();
BOOL bGuiVisible = (hChildGUI && nShowCmd) ? pVCon->RCon()->isGuiVisible() : FALSE;
DWORD nDcShowCmd = nShowCmd;
if (gpSetCls->isAdvLogging)
{
if (hChildGUI != NULL)
_wsprintf(sInfo, SKIPLEN(countof(sInfo)) L"ShowView: Back=x%08X, DC=x%08X, ChildGUI=x%08X, ShowCMD=%u, ChildVisible=%u",
(DWORD)mh_WndBack, (DWORD)mh_WndDC, (DWORD)hChildGUI, nShowCmd, bGuiVisible);
else
_wsprintf(sInfo, SKIPLEN(countof(sInfo)) L"ShowView: Back=x%08X, DC=x%08X, ShowCMD=%u",
(DWORD)mh_WndBack, (DWORD)mh_WndDC, nShowCmd);
gpConEmu->LogString(sInfo);
}
if (hChildGUI || (GetCurrentThreadId() != nTID))
{
// Только Async, иначе можно получить dead-lock
bRc = ShowWindowAsync(mh_WndBack, nShowCmd);
if (bGuiVisible && !mp_VCon->RCon()->isGuiForceConView())
nDcShowCmd = SW_HIDE;
bRc = ShowWindowAsync(mh_WndDC, nDcShowCmd);
}
else
{
bRc = ShowWindow(mh_WndBack, nShowCmd);
bRc = ShowWindow(mh_WndDC, nShowCmd);
if (nShowCmd)
{
SetWindowPos(mh_WndDC, HWND_TOP, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
SetWindowPos(mh_WndBack, mh_WndDC, 0, 0, 0,0, SWP_NOSIZE|SWP_NOMOVE);
}
}
if (nShowCmd && bGuiVisible)
{
// Если активируется таб с ChildGui
if (pVCon->isActive(false))
{
PostRestoreChildFocus();
}
}
return bRc;
}