PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WINDEV 2024 → WD21 - Restore Window To Normal
WD21 - Restore Window To Normal
Débuté par André Labuschagné, 24 aoû. 2016 23:39 - 2 réponses
Posté le 24 août 2016 - 23:39
Hi All

I have now got my app working so that the user cannot change the size. After opening the app I press the minimize button and it is displayed in the task bar. In my procedure with a timer I have code that now detects that it is minimized. Once detected I apply the Restore function to the window and it does not come to the foreground as normal size again. I have tried set focus but that has also not worked. How can I get the window to come to the foreground as normal size?

Cheers
André
Posté le 25 août 2016 - 14:25
Hi André,

I had that problem in an old project. Here is the piece of code I used to fix it. This small utility still works very well. Hopefully the same code will solve your issue. This is in French, but you can switch the code to English if you want (except the comments of course):

// Si la fenêtre est minimisée, alors nous l'affichons en mode "normal" (nous ne savons pas si elle était maximisée) SI nAction = 0 _OU_ FenTaille(sFen) = TailleMini ALORS FenTaille(sFen,TailleNormale) // Nous faisons tout ce qui est en notre possible pour remettre la fenêtre au premier plan (fonctionne sous XP du moins) //ActifDevant ne fait pas ce qui est attendu (peut-être parce que la fenêtre n'a aucun champ de saisie) FenEtat(sFen,ActifDevant) // S'assure que l'écran sera en saisie (avec Invisible, la saisie est impossible par la suite) FenEtat(sFen,DessusTout) // Affiche la fenêtre au-dessus de tout (permanent) FenEtat(sFen,Normal) // Remet la fenêtre en mode normal (pour ne pas rester DessusTout à toujours) SINON FenTaille(sFen,TailleMini) FIN
Best regards,
Alexandre Leclerc
Posté le 25 août 2016 - 16:19
Hi Alexandre

That was absolutely spot on. Thank you for all your help over the last few days. it has moved this project forward tremendously. You help and sharing is much appreciated.

Till next time....

Merci beaucoup
André