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
2.函数申明:
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
type point from structure
long x
long y
end type 这个结构名称必须是point吗
subroutine GetMinMaxInfo ( ref minmaxinfo d, long s, long l ) library 'kernel32.dll' alias for RtlMoveMemory 声明出错!
把subroutine换成function!而且不知道这函数返会值类型!我就用了ulong !
以下是我的代码:
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
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.ptMaxTrackSize.x = UnitsToPixels(il_orig_width, XUnitsToPixels!)
lstr_MinMaxInfo.ptMaxTrackSize.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
实例变量:
long il_orig_width=3690, il_orig_height=2320 //为在800*600下最大化的width&height,自己测试取值