WM_SIZE

发送时间:当窗口大小改变时.
详细时间:1.当窗口大小改变时,如最大化,最小化,用鼠标拉伸窗口.
2.当窗口刚被创建时


参数说明:
wParam:
Specifies the type of resizing requested.
通常用来向别的窗口发送消息时,需要指定的附加信息
ValueMeaning
SIZE_MAXHIDEMessage is sent to all pop-up windows when some other window is maximized.
SIZE_MAXSHOWMessage 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.
ValueMeaning
SIZE_RESTOREDThe 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是新窗口客户区的大小!宽度和高度


 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值