本文整理汇总了C++中Layout::ActiveWindow方法的典型用法代码示例。如果您正苦于以下问题:C++ Layout::ActiveWindow方法的具体用法?C++ Layout::ActiveWindow怎么用?C++ Layout::ActiveWindow使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Layout
的用法示例。
在下文中一共展示了Layout::ActiveWindow方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: switch
LRESULT CALLBACK EXPORT AWLayoutWndProc
(
HWND hwnd,
UINT uMsg,
WPARAM wParam,
LPARAM lParam
)
{
BOOL fHandled = FALSE;
LRESULT lRet;
Layout* pLayout = (Layout*)GetWindowLong(hwnd, I_GWL_LAYOUT);
switch(uMsg)
{
case WM_CREATE:
pLayout = (Layout*)(((CREATESTRUCT*)lParam)->lpCreateParams);
SetWindowLong(hwnd, I_GWL_LAYOUT, (long)pLayout);
pLayout->m_hwndLayout = hwnd;
fHandled = TRUE;
lRet = 0L;
break;
case WM_SYSCOMMAND:
if((wParam & 0xFFF0)==SC_CLOSE)
{
FORWARD_WM_COMMAND(hwnd, IDM_EXIT, 0, 0, PostMessage);
fHandled = TRUE;
lRet = 0L;
break;
}
break;
case WM_QUERYENDSESSION:
MessageBeep(MB_ICONEXCLAMATION);
MessageBox(hwnd, "Window layout is still active.\r\n\r\nQuit the window layout before quitting Windows.", "Window Layout", MB_TASKMODAL | MB_OK | MB_ICONEXCLAMATION);
lRet = 0;
fHandled = TRUE;
break;
case WM_KEYDOWN:
(pLayout->m_shapes).KeyDown(pLayout->m_pWndActive, hwnd, (int)wParam, lParam);
fHandled = TRUE;
lRet = 0L;
break;
case WM_KEYUP:
(pLayout->m_shapes).KeyUp(pLayout->m_pWndActive, hwnd, (int)wParam, lParam);
fHandled = TRUE;
lRet = 0L;
break;
case WM_INITMENUPOPUP:
HANDLE_WM_INITMENUPOPUP(hwnd, wParam, lParam, pLayout->InitMenuPopup);
fHandled = TRUE;
lRet = 0L;
break;
case WM_PALETTECHANGED:
if ((pLayout->ActiveWindow()) && ((HWND)wParam==pLayout->ActiveWindow()->ClientWnd()))
break;
// else fall through
case WM_QUERYNEWPALETTE:
if(!IsIconic(hwnd) && pLayout->ActiveWindow() && WndData::GetPaletteHandle())
{
HDC hdc = GetDC(pLayout->ActiveWindow()->ClientWnd());
HPALETTE hpalOld = SelectPalette(hdc, WndData::GetPaletteHandle(), FALSE);
lRet = RealizePalette(hdc);
SelectPalette(hdc, hpalOld, TRUE);
RealizePalette(hdc);
ReleaseDC(pLayout->ActiveWindow()->ClientWnd(), hdc);
if(lRet)
InvalidateRect(pLayout->ActiveWindow()->ClientWnd(), NULL, TRUE);
fHandled = TRUE;
}
break;
case WM_HSCROLL:
HANDLE_WM_HSCROLL(hwnd, wParam, lParam, pLayout->HScroll);
fHandled = TRUE;
lRet = 0;
break;
case WM_VSCROLL:
HANDLE_WM_VSCROLL(hwnd, wParam, lParam, pLayout->VScroll);
fHandled = TRUE;
lRet = 0L;
break;
case WM_SIZE:
pLayout->UpdateScrollRegion();
fHandled = TRUE;
lRet = 0L;
break;
case WM_COMMAND:
HANDLE_WM_COMMAND(hwnd, wParam, lParam, pLayout->Command);
fHandled = TRUE;
lRet = 0L;
//.........这里部分代码省略.........