Information générale
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Srdjan,
The following code will cause the two methods to fire when the user resizes the form. OnWindowResizeEnter fires BEFORE the user begins resizing. OnWindowResizeExit fires AFTER the user is done resizing. This is something that you can't get with any of the standard VFP events.
I included some code at the end that runs AS the user resizes the form. This is very similar to the VFP resize so you might not need it.
Thanks,
Steve
*---------------------------------------------------------------------
* Set the API calls for intercepting the Windoes resizing messages
*---------------------------------------------------------------------
#define WM_ENTERSIZEMOVE 0x0231
#define WM_EXITSIZEMOVE 0x0232
#define WM_SIZE 0x0005
#define BE_FireAfterEvent 0
BINDEVENT (ThisForm.HWnd, WM_ENTERSIZEMOVE, ;
This, "OnWindowResizeEnter", ;
BE_FireAfterEvent)
BINDEVENT (ThisForm.HWnd, WM_EXITSIZEMOVE, ;
This, "OnWindowResizeExit", ;
BE_FireAfterEvent)
METHOD CODE For OnWindowResizeEnter
LPARAMETERS hWnd, nMsg, nwParam, nlParam
METHOD CODE For OnWindowResizeExit
LPARAMETERS hWnd, nMsg, nwParam, nlParam
*====================================================
* Expanded resize event
*====================================================
*!* BINDEVENT (This.HWnd, WM_SIZE, ;
*!* ThisForm, "OnWindowSizeChange", ;
*!* BE_FireAfterEvent)
*!* Method OnWindowSizeChange
*!* LPARAMETERS hWnd, nMsg, nwParam, nlParam
*!* #DEFINE SIZE_RESTORED 0
*!* #DEFINE SIZE_MINIMIZED 1
*!* #DEFINE SIZE_MAXIMIZED 2
*!* #DEFINE SIZE_MAXSHOW 3
*!* #DEFINE SIZE_MAXHIDE 4
*!* DO CASE
*!* CASE nwParam = SIZE_RESTORED
*!* * MESSAGEBOX("Restored")
*!* CASE nwParam = SIZE_MINIMIZED
*!* * MESSAGEBOX("Minimized")
*!* CASE nwParam = SIZE_MAXIMIZED
*!* * MESSAGEBOX("Maximized")
*!* CASE nwParam = SIZE_MAXSHOW
*!* CASE nwParam = SIZE_MAXHIDE
*!* ENDCASE
*!* RETURN 0
*====================================================
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement