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. RAC本地数据文件迁移至ASM的方法--非归档模式

    系统环境:rhel6.2_x64+Oracle RAC11g 操作过程: 1.非归档模式 SQL> archive log list; Database log mode No Archive ...

  2. 第一章 管理程序流(In .net4.5) 之 实现多线程和异步处理

    1. 概述 本章主要讲解.net4.5如何实现多线程和异步处理的相关内容. 2. 主要内容 2.1 理解线程 ① 使用Thread类   public static class Program   { ...

  3. sublime text 3 设置

    最近开始用sublime text 3,查资料总结了一下常用的设置,记录下以备用,同时也希望能改大家带来方便 0.使用package control安装,点前边超链接,复制左侧代码到console,回 ...

  4. NOJ1008-第几天

    第几天 时间限制(普通/Java) : 1000 MS/ 3000 MS          运行内存限制 : 65536 KByte总提交 : 2701            测试通过 : 800  ...

  5. node.js 使用 UglifyJS2 高效率压缩 javascript 文件

    UglifyJS2 这个工具使用很长时间了,但之前都是在 gulp 自动构建 时用到了 UglifyJS 算法进行压缩. 最近玩了一下 UglifyJS2 ,做了一个 在线压缩javascript工具 ...

  6. Mybatis typeAliases别名

    <typeAliases> <typeAlias type="com.green.phonemanage.model.CellPhone" alias=" ...

  7. Android里面的命名规范

    前前后后接触安卓也有一段时间了,但是对于Android命名规范这块一直没有太注意过.导致有的时候写出来的代码,前后的风格根本不一样,今天在网上查了一下,正好对自己来说可以好好的总结一下. 首先在And ...

  8. Windows下使用Visual Studio Code搭建Go语言环境

    1.安装GO语言   下载地址:    https://golang.org/dl/   Windows下直接运行安装GO语言即可.     安装成功.   安装完毕GO语言后,需要添加GOPATH环 ...

  9. iOS学习之视图控制器

    一.自定义视图(label-textField组合视图)      1.自定义视图:系统标准UI之外,自己组合出的新的视图.      2.优点:iOS提供了很多UI组件,借助它们我们可以实现不同的功 ...

  10. Swift 类构造器的使用

    Swift 中构造器需要遵循的规则还是很多的, 总结一下, 有以下规则: 调用相关 指定构造器必须调用它直接父类的指定构造器方法. 便利构造器必须调用同一个类中定义的其它初始化方法. 便利构造器在最后 ...