Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the messagebox title
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00550255
Message ID:
00551005
Views:
31
>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 Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform