posted 04-10-2008 04:24 PM
Here is a replacement function for the EZ_MsgBoxEx function which allows you to unload the messagebox within a time limit (first parameter is number of seconds to wait before unloading).code:
SUB EZ_TMBProc(BYVAL hWnd&, BYVAL uMsg&, BYVAL idEvent&, BYVAL dwTime&)
IF EZ_IsForm("{MSGBOX}", "V") THEN EZ_UnloadForm "{MSGBOX}"
END SUB
'
FUNCTION EZ_MsgBoxExT (BYVAL Seconds!, BYVAL FormName$, BYVAL MText$, BYVAL MTitle$, BYVAL B1$, BYVAL B2$, BYVAL B3$, BYVAL Pict$, BYVAL Prop$, BYVAL Font1&, BYVAL Font2&) AS LONG
LOCAL MS&, TMID&
MS&=INT(Seconds!*1000)
TMID&= SetTimer(0, 0, MS&, CODEPTR(EZ_TMBProc))
FUNCTION=EZ_MsgBoxEx(FormName$, MText$, MTitle$, B1$, B2$, B3$, Pict$, Prop$, Font1&, Font2&)
KillTimer 0, TMID&
END FUNCTION
The above code uses two API functions:
SetTimer
KillTimer
You can either include the win32api.inc file or simply add just the declarations for these functions.
The above function is identical to EZ_MsgBoxEx, except is one more parameter which defines the seconds to wait before unloading the messagebox.