PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → minimiser fenêtre.... suite !
minimiser fenêtre.... suite !
Débuté par Paul, 01 mai 2006 17:39 - 2 réponses
Posté le 01 mai 2006 - 17:39
Bonjour, voici le code que j'utilise pour effectuer un traitement lorsque l'utilisateur clique sur le bouton minimiser de la fênetre principale dans mon appli...

cependant, ce code s'effectue sur n'importe quelle fenêtre de mon appli alors que je veux qu'il s'exécute pour le fenêtre principale uniquement... Qqn à une idée ???

merci !

Paul

********************************************************************88
Tout d'abord déclarer les constantes

//Specifies the type of resizing requested. This parameter can be one of the following values.
CONSTANT
SIZE_MAXHIDE= 0x0004
//Message is sent to all pop-up windows when some other window is
maximized.
SIZE_MAXIMIZED = 0x0003
//The window has been maximized.
SIZE_MAXSHOW = 0x0002
//Message is sent to all pop-up windows when some other window has
been restored to its former size.
SIZE_MINIMIZED = 0x0001
//The window has been minimized.
SIZE_RESTORED = 0x0000
//The window has been resized, but neither the SIZE_MINIMIZED nor
SIZE_MAXIMIZED value applies.

//lParam
//The low-order word of lParam specifies the new width of the client area.
//The high-order word of lParam specifies the new height of the client area.

FIN

Ensuite dans le code de déclaration des globales appeler la fonction sur evenemet

Evénement("ON_WM_SIZE", "*.", WM_SIZE)

puis créer la fonction ON_WM_SIZE

PROCEDURE ON_WM_SIZE(message,wParam,lParam)

SELON wParam
//Specifies the type of resizing requested. This parameter can be one of the following values.
CAS SIZE_MAXHIDE // ( 4 ou 0x0004 )
//Message is sent to all pop-up windows when some other window is
maximized.
Trace("SIZE_MAXHIDE largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

CAS SIZE_MAXIMIZED // ( 3 ou 0x0003 )
//The window has been maximized. ( CLICK SUR LE BOUTON
D'AGRANDISSEMENT MAXI bouton de droite )
Trace("SIZE_MAXIMIZED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

CAS SIZE_MAXSHOW //( 2 ou 0x0002 )
//Message is sent to all pop-up windows when some other window
has been restored to its former size.
Trace("SIZE_MAXSHOW largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

//
// MINIMISER C ICI
//
CAS SIZE_MINIMIZED // ( 1 ou 0x0001 )
//The window has been minimized. ( CLIC SUR LE BOUTON DE
REDUCTION bouton de gauche)
Trace("SIZE_MINIMIZED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

// ICI PoidsFaible(lParam) est toujours égal à 0 et PoidsFort(lParam)<=0
// j'ai toujours PoidsFort(lParam)=0 en MDI et PoidsFort(lParam) =-24 sans MDI

//
//

CAS SIZE_RESTORED // ( 0 ou 0x0000 )
//Changemet de taille manuel ( coin droite bas ) ou restoration
de la taille bouton du milieu .
Trace("SIZE_RESTORED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))


//lParam
//The low-order word of lParam specifies the new width of the client area.
//The high-order word of lParam specifies the new height of the client area.
AUTRE CAS

FIN
Posté le 02 mai 2006 - 11:04
Salut,

Je dirais que tu devrais mettre:

Evénement("ON_WM_SIZE", "Fenêtre Principale", WM_SIZE)

Bon dev,

Philippe

Paul a écrit :
Bonjour, voici le code que j'utilise pour effectuer un traitement lorsque l'utilisateur clique sur le bouton minimiser de la fênetre principale dans mon appli...

cependant, ce code s'effectue sur n'importe quelle fenêtre de mon appli alors que je veux qu'il s'exécute pour le fenêtre principale uniquement... Qqn à une idée ???

merci !

Paul

********************************************************************88
Tout d'abord déclarer les constantes

//Specifies the type of resizing requested. This parameter can be one of the following values.
CONSTANT
SIZE_MAXHIDE= 0x0004
//Message is sent to all pop-up windows when some other window is
maximized.
SIZE_MAXIMIZED = 0x0003
//The window has been maximized.
SIZE_MAXSHOW = 0x0002
//Message is sent to all pop-up windows when some other window has
been restored to its former size.
SIZE_MINIMIZED = 0x0001
//The window has been minimized.
SIZE_RESTORED = 0x0000
//The window has been resized, but neither the SIZE_MINIMIZED nor
SIZE_MAXIMIZED value applies.

//lParam
//The low-order word of lParam specifies the new width of the client area.
//The high-order word of lParam specifies the new height of the client area.

FIN

Ensuite dans le code de déclaration des globales appeler la fonction sur evenemet

Evénement("ON_WM_SIZE", "*.", WM_SIZE)

puis créer la fonction ON_WM_SIZE

PROCEDURE ON_WM_SIZE(message,wParam,lParam)

SELON wParam
//Specifies the type of resizing requested. This parameter can be one of the following values.
CAS SIZE_MAXHIDE // ( 4 ou 0x0004 )
//Message is sent to all pop-up windows when some other window is
maximized.
Trace("SIZE_MAXHIDE largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

CAS SIZE_MAXIMIZED // ( 3 ou 0x0003 )
//The window has been maximized. ( CLICK SUR LE BOUTON
D'AGRANDISSEMENT MAXI bouton de droite )
Trace("SIZE_MAXIMIZED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

CAS SIZE_MAXSHOW //( 2 ou 0x0002 )
//Message is sent to all pop-up windows when some other window
has been restored to its former size.
Trace("SIZE_MAXSHOW largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

//
// MINIMISER C ICI
//
CAS SIZE_MINIMIZED // ( 1 ou 0x0001 )
//The window has been minimized. ( CLIC SUR LE BOUTON DE
REDUCTION bouton de gauche)
Trace("SIZE_MINIMIZED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))

// ICI PoidsFaible(lParam) est toujours égal à 0 et PoidsFort(lParam)<=0
// j'ai toujours PoidsFort(lParam)=0 en MDI et PoidsFort(lParam) =-24 sans MDI

//
//

CAS SIZE_RESTORED // ( 0 ou 0x0000 )
//Changemet de taille manuel ( coin droite bas ) ou restoration
de la taille bouton du milieu .
Trace("SIZE_RESTORED largeur : "+PoidsFaible(lParam)+" Hauteur : "+PoidsFort(lParam))


//lParam
//The low-order word of lParam specifies the new width of the client area.
//The high-order word of lParam specifies the new height of the client area.
AUTRE CAS

FIN


Posté le 02 mai 2006 - 16:24
Merci Philippe !!!!

tu as trouvé la solution....