• Win32 Plus Extra Height of Caption Bar


    you set the size of the non-client area by handling the WM_NCCALCSIZE message. But don't do this unless you plan to do all of the non-client drawing as well by handling WM_NCPAINT

    Edit: here are two code fragments, one that handles WM_NCCALCSIZE and provides a simple n pixel border, and another than adds some extra pixels after DefWindowProc has done the default handling.

     1 case WM_NCCALCSIZE:
     2   {
     3   lRet = 0;
     4   const int cxBorder = 2;
     5   const int cyBorder = 2;
     6   InflateRect((LPRECT)lParam, -cxBorder, -cyBorder);
     7   }
     8 
     9 case WM_NCCALCSIZE: 
    10   {
    11   LPNCCALCSIZE_PARAMS pncc = (LPNCCALCSIZE_PARAMS)lParam;
    12   //pncc->rgrc[0] is the new rectangle
    13   //pncc->rgrc[1] is the old rectangle
    14   //pncc->rgrc[2] is the client rectangle
    15 
    16   lRet = DefWindowProc (hwnd, WM_NCCALCSIZE, wParam, lParam);
    17   pncc->rgrc[0].top += ExtraCaptionHeight;
    18   }

    You can learn a lot by passing WM_NCCALCSIZE to DefWindowProc and looking at the values of the NCCALCSIZEPARAM before and after.

  • 相关阅读:
    Java 多态
    Java 继承与抽象类
    Java 接口
    关于Oracle数据库故障诊断基础架构
    监控性能
    监视错误和警报
    内存管理参考
    使用自动内存管理
    内存架构概述
    关于内存管理
  • 原文地址:https://www.cnblogs.com/gabo/p/3801268.html
Copyright © 2020-2023  润新知