procedure WMSize (var Message: TWMSize);  message WM_SIZE;

参数说明

wParam:
Specifies the type of resizing requested.
通常用来向别的窗口发送消息时,需要指定的附加信息
Value
Meaning
SIZE_MAXHIDE
Message is sent to all pop-up windows when some other window is maximized.
SIZE_MAXSHOW
Message is sent to all pop-up windows when some other window has been restored to its former size.
SIZE_MINIMIZED
The window has been minimized.
Value
Meaning
SIZE_RESTORED
The window has been resized, but neither the SIZE_MINIMIZED nor SIZE_MAXIMIZED value applies.
lParam:
The low-order word of lParamspecifies the new width of the client area.
The high-order word of lParam specifies the new height of the client area.
note:
lParam和GetClientRect的功能一样,有时候WM_SIZE的效率要比使用GetClientRect高. 可以在程序中使用WM_SIZE来保存Client area的大小方便以后使用.
WM_SIZE后于WM_CREATE消息!!在窗口被创建时的顺序!
WM_SIZE附带的信息:
WM_SIZE
fwSizeType = wParam; // resizing flag
nWidth = LOWORD(lParam); // width of client area
nHeight = HIWORD(lParam); // height of client area
告诉我们Windows处理窗口大小变化后新窗口客户区的大小.
Message Cracker
void Cls_OnSize(HWND hwnd, UINT state, int cx, int cy)
...{
//do ...
}
参数cx,cy是新窗口客户区的大小!宽度和高度
注意cx,cy最好定义为全局或是静态的,例子如下
static UINT cx,cy;
switch (message)
{
case WM_SIZE:
cx=LOWORD(lParam);
cy=HIWORD(lParam);
break;
 

WM_SIZE的更多相关文章

  1. WM_SIZE后于WM_CREATE消息!!在窗口被创建时的顺序!

    WM_SIZE   procedure WMSize (var Message: TWMSize); message WM_SIZE; 参数说明 wParam: Specifies the type ...

  2. WM_SIZE和WM_MOVE的函数体内容为什么不一样?

    搞不懂,要想一想- procedure TWinControl.WMSize(var Message: TWMSize); begin UpdateBounds; // 类函数 inherited; ...

  3. DirectX Graphics Infrastructure(DXGI):最佳范例 学习笔记

    今天要学习的这篇文章写的算是比较早的了,大概在DX11时代就写好了,当时龙书11版看得很潦草,并没有注意这篇文章,现在看12,觉得是跳不过去的一篇文章,地址如下: https://msdn.micro ...

  4. C#调用SendMessage 用法

    函数功能:该函数将指定的消息发送到一个或多个窗口.此函数为指定的窗口调用窗口程序,直到窗口程序处理完消息再返回.该函数是应用程序和应用程序之间进行消息传递的主要手段之一.    函数原型:LRESUL ...

  5. 【Windows编程】系列第六篇:创建Toolbar与Statusbar

    上一篇我们学习了解了如何使用Windows GDI画图,该应用程序都是光光的静态窗口,我们使用Windows应用程序,但凡稍微复杂一点的程序都会有工具栏和状态栏,工具栏主要用于一些快捷功能按钮.比如典 ...

  6. (转载)解决GDI闪烁

    一般的windows 复杂的界面需要使用多层窗口而且要用贴图来美化,所以不可避免在窗口移动或者改变大小的时候出现闪烁. 先来谈谈闪烁产生的原因 原因一:如果熟悉显卡原理的话,调用GDI函数向屏幕输出的 ...

  7. Notepad++源码编译及其分析

    Notepad++是一个小巧精悍的编辑器,其使用方法我就不多说了,由于notepad++是使用c++封装的windows句柄以及api来实现的,因此对于其源码的研究有助于学习如何封装自己简单的库(当然 ...

  8. pywin32 创建一个窗口

    import win32con,win32gui class MyWindow(): def __init__(self): #注册一个窗口类 wc = win32gui.WNDCLASS() wc. ...

  9. Duilib源码分析(四)绘制管理器—CPaintManagerUI—(前期准备四)

    接下来,分析uilib.h中的WinImplBase.h和UIManager.h: WinImplBase.h:窗口实现基类,已实现大部分的工作,基本上窗口类均可直接继承该类,可发现该类继承于多个类, ...

随机推荐

  1. boost.compressed_pair源码剖析

    意义 当compressed_pair的某一个模板参数为一个空类的时候将对其进行“空基类优化”,这样可以使得compressed_pair占用的空间比std::pair的更小. 参考如下代码: #in ...

  2. Freemarker中通过request获得contextPath

    <!-- config Freemarker View Resolver--> <bean id="viewResolver" class="org.s ...

  3. Java多线程 wait, notify 和 notifyAll

    Java的Object类 public class Object { public final native void notify(); public final native void notif ...

  4. 发布自己的nuget包;报错source parameter was not specified

    16-10-27 VS下使用 程序包管理器控制台 运行: 1.cd 命令走到 工程文件夹下,使用 ls 命令查看当前目录: 2. 使用 nuget spec 创建: 3. 使用 nuget pack ...

  5. java 部署服务报:Bad version number in .class file

    问题原因:服务器jdk版本和class文件的版本不一致,一般是服务器的jdk版本低于class文件的编译版本 解决方案:修改服务器的jdk

  6. windows下使用pthreads

    pthread-win32在Windows上实现了线程相关的Posix标准,接口一模一样 包含: thread mutex cond swlock spin sem barrier https://s ...

  7. tomcat 6.0.44 “has failed to stop it. This is very likely to create a memory leak” 问题调查

    1. 问题起因 我们项目中缓存模块某个实现采用了ehcache(2.4.3),当项目部署到tomcat中后,对tomcat做停止服务操作(点击eclipse的console红色的停止按钮,奇怪的是有小 ...

  8. c++ template怎么使用及注意事项

    c++ 中的template和c#的什么有点相似? 先看下定义方式: template <typename|class T> T myFunction(T param1,T param2. ...

  9. Leetcode: Perfect Rectangle

    Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover o ...

  10. Lintcode: Segment Tree Modify

    For a Maximum Segment Tree, which each node has an extra value max to store the maximum value in thi ...