在PB中限制窗口的 Mini Size

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   
subroutine  SetMinMaxInfo  (  long  d,  minmaxinfo  s,  long  l  )  library  'kernel32.dll'  alias  for  RtlMoveMemory 

2.定义变量做为窗口的最小宽度和高度(MIN  SIZE) 
long  il_orig_width=400,  il_orig_height=400 

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 
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值