WM_GETMINMAXINFO -- changing MinTrackSize causes GPF 
Author Message
 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 ^



Sat, 15 Aug 1998 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Changing Form Icon causes a GPF!

2. GPF Caused by Copy Object and Make Tabler

3. Warnings False Causes GPF True doesn't???

4. Emailing a doc causes GPF in Winword.exe

5. GPF caused by a UserForm

6. Converting VB4 vbp to vb5 cause GPF

7. data1.refresh causes GPF in MSJT3032.DLL...anyone?`

8. DBCombo Causes GPF

9. Oracle Data Control causes GPF

10. Access 2.0 VB3.0/Excel SQLExecQuery single quote causes GPF

11. Data access with multiple 16-bit VB4 EXEs causes GPF

12. VB and Oracle 7 causes GPF

 

 
Powered by phpBB® Forum Software