在PB中限制窗口的最小尺寸
以下代码PB12测试通过。1.定义结构,外部函数
type point from structure
long x
long y
end type
type minmaxinfo from structure
point ptreserved
point ptmaxsize
point ptmaxposition
point ptmintracksize
point ptmaxtracksize
end type
subroutine GetMinMaxInfo ( ref minmaxinfo d, long s, long l ) library 'kernel32.dll ' alias for "RtlMoveMemory;Ansi"
subroutine SetMinMaxInfo ( long d, minmaxinfo s, long l ) library 'kernel32.dll ' alias for "RtlMoveMemory;Ansi"
2.定义变量做为窗口的最小宽度和高度(MIN SIZE)
long il_orig_width=PixelsToUnits(800,XPixelsToUnits!)
long il_orig_height=PixelsToUnits(600,YpixelsToUnits!)
3.自定义事件
ue_minmaxinfo(pbm_getminmaxinfo)
MinMaxInfo lstr_MinMaxInfo
/* copy the data, pointed by the argument MinMaxInfo, to our lstr_MinMaxInfo structure */
GetMinMaxInfo(lstr_MinMaxInfo, MinMaxInfo, 40)
/* set the minimal size for our window */
lstr_MinMaxInfo.ptMinTrackSize.x = UnitsToPixels(il_orig_width, XUnitsToPixels!)
lstr_MinMaxInfo.ptMinTrackSize.y = UnitsToPixels(il_orig_height, YUnitsToPixels!)
/* copy the structure back into memory at the same place */
SetMinMaxInfo(MinMaxInfo,lstr_MinMaxInfo,40)
/* important, according to the MS API, we must return 0 */
return 0
太帅了支持一下,我群里的! yuer 发表于 2011-5-20 17:54 static/image/common/back.gif
太帅了支持一下,我群里的!
欢迎常来光顾! 原来是控制最大化,最小化的大小。 不错的东东谢谢分享了哈
我也群里的 嘿嘿 支持支持!!!!!!!!!!!!!!!!!!!!!
页:
[1]