Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing the messagebox title
Message
 
To
30/08/2001 11:39:51
Mike Sue-Ping
Cambridge, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00550255
Message ID:
00550926
Views:
22
>Thanks for the suggestion George.
>
>I realize that my VFP app has no way of "seeing" the messagebox and hence change the caption as the user waits to respond. However, I thought that was where the Windows API calls come in handy. I think that I should be able to get a handle to the window messagebox, but once I do, then what?
>
Mike,

Please forgive me, but I didn't think what you where trying to do through enough. How well the following will work, however, is up to you. Here's how...

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
Simply enable the timer prior and set the nSecondsLeft property priot to calling the MESSAGEBOX() function. Note that I did not test this with varying levels of modality available to the MESSAGEBOX() function and that I did not test in run-time mode, simply in design time.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform