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.

  • 相关阅读:
    第五次实验作业
    第四次作业
    java三
    java作业二
    java作业一
    作业11
    作业10
    作业9
    作业8
    作业7
  • 原文地址:https://www.cnblogs.com/gabo/p/3801268.html
Copyright © 2011-2022 走看看