UBBFriend: Email This Page to Someone!
  Computer Workshop User Forums
  EZGUI Source code
  A timed Messagebox

Post New Topic  Post A Reply
profile | register | preferences | faq | search

next newest topic | next oldest topic
Author Topic:   A timed Messagebox
Chris Boss
Administrator
posted 04-10-2008 04:24 PM     Click Here to See the Profile for Chris Boss     Edit/Delete Message Reply w/Quote
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.

All times are EST (US)

next newest topic | next oldest topic

Administrative Options: Close Topic | Archive/Move | Delete Topic
Post New Topic  Post A Reply
Hop to:

Contact Us | Computer Workshop ( EZGUI ) Home Page

Copyright 2000 to 2007 Christopher R. Boss

Powered by: Ultimate Bulletin Board, Version 5.44
© Infopop Corporation (formerly Madrona Park, Inc.), 1998 - 2000.