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


C++ Layout::ActiveWindow方法代码示例

本文整理汇总了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;
//.........这里部分代码省略.........
开发者ID:benbucksch,项目名称:AppWare,代码行数:101,代码来源:LAY_WPRC.CPP


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