通用放大缩小/适用多层组件的自适应窗口大小

易语言 2020-03-12 15:13:45

通用放大缩小/适用多层组件的自适应窗口大小

这个源码就是修改了这个问题。

窗口_枚举所有子窗口EX (_启动窗口.取窗口句柄 (), _ChildHwnd, ) ' 之前的方法组件句柄取不完整
.计次循环首 (取数组成员数 (_ChildHwnd), i)
GetWindowRect (_ChildHwnd [i], tem)
加入成员 (Rect, tem)
GetWindowRect (窗口_取父句柄 (_ChildHwnd [i]), 临时) ' 取父窗口的顶边和左边
Proportion_.Left = (_Rect [i].Left - 临时.Left) ÷ 宽度
Proportion_.Top = (_Rect [i].Top - 临时.Top) ÷ 高度
Proportion_.width = (_Rect [i].Right - _Rect [i].Left) ÷ 宽度
Proportion_.height = (_Rect [i].Bottom - _Rect [i].Top) ÷ 高度
加入成员 (_Proportion, Proportion_)
.计次循环尾 ()