Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
CallWindowProc and WM_GetMinMaxInfo
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01392525
Message ID:
01392537
Vues:
57
Hi Matt,

You're confusing the Event handler and CallWindowProc() parameters. The the Event handler receives only 4 parameters (hWnd as Integer, Msg as Integer, wParam as Integer, lParam as Integer). The 4th parameter is a pointer to the MINMAXINFO structure and you can use SYS(2600) to retrieve the structure. The string holds binary data so it'll look strange if you try to display it.
The MINMAXINFO structure consists of five POINT Structures. The POINT Structure consists of two 4 byte integers (x and y values respectively).
After you get the MINMAXINFO structure, you can retrieve its members and convert them to VFP numbers. Or you can use my Windows API support class to retrieve them directly from lParam pointer
loWas = NEWOBJECT("WinApiSupport", "WinApiSupport.fxp")
lnMaxSizeX = loWas.Long2NumFromBuffer(lParam+8) 
lnMaxSizeY = loWas.Long2NumFromBuffer(lParam+12) 
...
lnMaxTrackSizeX = loWas.Long2NumFromBuffer(lParam+32) 
lnMaxTrackSizeY = loWas.Long2NumFromBuffer(lParam+36) 
>I'm having a little trouble wrapping my head around how to get the information I'm looking for from CallWindowProc and WM_GetMinMaxInfo.
>
>My goal is to be able to set a windows max or min size during a sizing event and I think I'm close, but I'm baffled by how this is (not) working.
>
>I have a bound event responding to WM_GETMINMAXINFO, and that's firing fine.
>
>The Declare function looks like this:
>
>DECLARE INTEGER CallWindowProc IN user32;
>        INTEGER lpPrevWndFunc, INTEGER hWindow, LONG Msg, ;
>        INTEGER wParam, INTEGER lParam
>
>
>This is the MS documentation on the last two parms with respect to WM_GETMINMAXINFO:

> wParam
> This parameter is not used.
> lParam
> Pointer to a MINMAXINFO structure that contains the default maximized position and dimensions, and the default minimum and maximum tracking sizes. An application can override the defaults by setting the members of this structure.
>
>In my event handler for this message, there are only 4 parameters passed (PCOUNT() = 4) and they look like this:
>2622176, 36, 0, 1242920
>
>So I'm confused. I _am_ getting a value in the 4th parm and nothing in the 5th. I tried using SYS(2600) assuming that the 4th parm was the pointer to the MINMAXINFO structure that I wanted, but that returned gobbledygook.
>

>
>-m@
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform