
WM_GETMINMAXINFO -- changing MinTrackSize causes GPF
Has anyone here successfully limited window size by catching the
WM_GETMINMAXINFO message and modifying the MINMAXINFO structure?
I know I'm catching the right message, because a BEEP statement stuck into
the code will execute whenever I resize. I can read the MINMAXINFO
structure and write it back unmodified with no problem, but if I modify the
MinTrackSize values before writing it back...
BOOM!
Are my declarations (below) okay?
Do I have a clue what I'm doing -- my documentation is pretty scanty?
' -------- in a .bas declaration -------
Declare Sub hmemcpy Lib "Kernel" (dst As Any, src As Any, ByVal bytecount&)
Type Type_POINT
X As Integer
Y As Integer
End Type
Type Type_MINMAXINFO
Reserved As Type_POINT
MaxSize As Type_POINT
MaxPosition As Type_POINT
MinTrackSize As Type_POINT
MaxTrackSize As Type_POINT
End Type
Global Const WM_GETMINMAXINFO = &H24
' -------- in the msgblaster event ------
Dim MinMaxInfo AS Type_MINMAXINFO
[snip]
Case WM_GETMINMAXINFO
' make a long version of the len() value
lStrucSize = Len(MinMaxInfo)
'lparam is a pointer to Type_MINMAXINFO
hmemcpy MinMaxInfo, lparam, lStrucSize
'MinMaxInfo.MinTrackSize.X = 5000 '<------ uncommenting these lines
'MinMaxInfo.MinTrackSize.Y = 5000 '<------ makes it blow up.
hmemcpy lparam, MinMaxInfo, lStrucSize
--
____D__a__v__i__d_____B__e__r__g__a__r__t___________________________________
please note new address ^