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.

 case WM_NCCALCSIZE:
{
lRet = ;
const int cxBorder = ;
const int cyBorder = ;
InflateRect((LPRECT)lParam, -cxBorder, -cyBorder);
} case WM_NCCALCSIZE:
{
LPNCCALCSIZE_PARAMS pncc = (LPNCCALCSIZE_PARAMS)lParam;
//pncc->rgrc[0] is the new rectangle
//pncc->rgrc[1] is the old rectangle
//pncc->rgrc[2] is the client rectangle lRet = DefWindowProc (hwnd, WM_NCCALCSIZE, wParam, lParam);
pncc->rgrc[].top += ExtraCaptionHeight;
}

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

Win32 Plus Extra Height of Caption Bar的更多相关文章

  1. Status bar and navigation bar appear over my view's bounds in iOS 7

    转自:http://stackoverflow.com/questions/17074365/status-bar-and-navigation-bar-appear-over-my-views-bo ...

  2. Customizing Navigation Bar and Status Bar

    Like many of you, I have been very busy upgrading my apps to make them fit for iOS 7. The latest ver ...

  3. Using SetWindowRgn

    Using SetWindowRgn Home Back To Tips Page Introduction There are lots of interesting reasons for cre ...

  4. File Input Features

    文件输入功能 1.该插件将将一个简单的 HTML 文件输入转换为高级文件选取器控件.将有助于对不支持 JQuery 或 Javascript 的浏览器的正常 HTML 文件输入进行回退. 2.文件输入 ...

  5. KRBTabControl

    This article explains how to make a custom Windows Tab Control in C#. Download demo project - 82.4 K ...

  6. windows程序设计读书笔记2——字符显示1

    本程序使用GetSystemMetrics获取windows各种图像选项,并输出字符到窗口中. #define WINVER 0x0500 #include <windows.h> #in ...

  7. 《windows程序设计》学习_4:文本输出,加滚动条

    //总行数 #define NUMLINES ((int) (sizeof sysmetrics / sizeof sysmetrics [0])) struct { int Index ; TCHA ...

  8. WTL介绍

    WTL简单介绍 关键词: WTL WTL是一个好东东.它开发的程序都很短小精悍.对开发WIN32的应用有很好的优点.它不用MFC开发.但可以高速产生窗体和控件. 以文本方式查看主题 -  温馨小筑   ...

  9. Installshield停止操作系统进程的代码 --IS6及以上版本适用

    原文:Installshield停止操作系统进程的代码 --IS6及以上版本适用 setup.rul的代码 Code;end;///////////////////////////////////// ...

随机推荐

  1. C++实现按绩点排名

    题目内容:有一些班级的学生需要按绩点计算并排名.每门课的成绩只有在60分以上(含),才予以计算绩点.课程绩点的计算公式为:(课程成绩-50)÷10×学分数.一个学生的总绩点为其所有课程绩点总和除以10 ...

  2. C++求等比数列之和

    题目内容:已知q与n,求等比数列之和:1+q+q2+q3+q4+……+qn. 输入描述:输入数据不多于50对,每对数据含有一个整数n(1<=n<=20).一个小数q(0<q<2 ...

  3. HDFS文件读写流程

    一.HDFS HDFS全称是Hadoop Distributed System.HDFS是为以流的方式存取大文件而设计的.适用于几百MB,GB以及TB,并写一次读多次的场合.而对于低延时数据访问.大量 ...

  4. [习题]日历(Calendar)控件的障眼法(.Visible属性),使用时才出现?不用就消失?

    原文出處  http://www.dotblogs.com.tw/mis2000lab/archive/2013/09/02/calendar_icon_visible.aspx [习题]日历(Cal ...

  5. Web Service 和WCF的比较

    Web Service 的工作原理 Web Service也叫XML Web Service WebService是一种可以接收从Internet或者Intranet上的其它系统中传递过来的请求,轻量 ...

  6. 重定向语句Response.Redirect()方法与Response.RedirectPermanent()对搜索引擎页面排名的影响

    在ASP.NET中,开发人员经常使用Response.Redirect()方法,用编程的手法,将对老的URL的请求转到新的URL上.但许多开发人员没有意识到的是,Response.Redirect() ...

  7. jQuery学习笔记(5)--表单域获得焦点和失去焦点样式变化

    <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> &l ...

  8. hadoop-cdh with snappy

    hadoop: 2.5.0-cdh5.3.6 snappy: 1.1.3 hadoop 2.*不需要hadoop-snappy.只要机器上安装好snappy, 直接编译就可以 编译命令: mvn cl ...

  9. POJ——3984

    走迷宫问题,POJ上面的题 #include <stdio.h> #include <stdlib.h> #define SIZE 5 bool findpath = fals ...

  10. virtualenv python虚拟环境搭建

    python virtualenv.py flask