zoukankan      html  css  js  c++  java
  • 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.

  • 相关阅读:
    Combox小问题
    数据库登录名,用户,角色以及权限分配
    UDP初识
    AJax 无刷新构建DataTable
    批量修改数据库构架SQL
    Jquery Ajax
    Linq中使用Group By
    对象的消息模型
    P2P网络技术概览与实现原理
    ajax(1)
  • 原文地址:https://www.cnblogs.com/gabo/p/3801268.html
Copyright © 2011-2022 走看看