Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Changing the messagebox title
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00550255
Message ID:
00551025
Vues:
25
>>First, you need two API function declarations
DECLARE INTEGER FindWindow IN Win32API;
>>  STRING @lpClass, STRING @lpTitle
>>DECLARE INTEGER SetWindowText IN Win32API;
>>  INTEGER hWnd, STRING @lpString
Next you'll need a timer, with something like the following in the Timer event
LOCAL lctitle, lnhwnd
>>* Naturally, you'll need a form property named as below and inititalized
>>* to the value of the timeout
>>lctitle = "Time remaining " + TRANSFORM(ThisForm.nSecondsLeft)
>>lnhwnd = FindWindow(0, @lctitle)
>>IF lnhwnd > 0
>>  ThisForm.nSecondsLeft = ThisForm.nSecondsLeft - 1
>>  lctitle = "Time remaining " + TRANSFORM(ThisForm.nSecondsLeft)
>>  = SetWindowText(lnhwnd, @lctitle)
>>ENDIF
>
>George,
>FYI, for whatever reason, this doesn't work in VFP 7 when you add the new timeout parameter. In VFP 6 and in VFP 7 without the timeout parameter, displaying a messagebox allows timer events to fire. It seems that the timer events are blocked when the messagebox is going to time out.

Larry,

Thanks for the heads up on this. I didn't test with the time-out parameter. It may be a kludge, but I wonder if setting the default button, then issuing a KEYBOARD command for the enter key when the time expires might be a workaround.
George

Ubi caritas et amor, deus ibi est
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform