1 (edited by CDB 2021-02-21 06:11:45)

Topic: Message Dialog with timeout

MessageDlgTimeOut(msg,caption,flags, milliseconds).

I think this function is missing an integer return!


As it stands, the buttons that are displayed cannot be interrogated, which makes displaying them pointless.

I have discovered that 'flags' is actually the button type constants to be displayed =.

0 =  OK
1 =  OK, CANCEL
2 =  ABORT, RETRY, CANCEL
3 =  YES, NO, CANCEL
4 =  YES, NO
5 =   RETRY, CANCEL
6 =   CANCEL, TRY AGAIN, CONTINUE

It would also be nice to perhaps have the option of displaying no buttons, in which case the function becomes a timed dialog message box.

I'm using v6.5

On a clear disk you can seek forever

Re: Message Dialog with timeout

CDB,
Instead of MessageDlg, you could try the attached. It is a timed message with no buttons. Basically it is another form specifically for displaying messages utilizing a timer. Once you have defined the message form and it's associated scripts, all you need to do is place the following line throughout your app to display various messages. You just need to insert your own Title and Message literals in the line of code.

TimedMsg('Your Caption','Your message');

Hope it helps.

Post's attachments

Attachment icon Timed Msg.zip 335.6 kb, 428 downloads since 2021-02-22 

Re: Message Dialog with timeout

Thanks EHWagner,


Your code is far more compact than what I was about to write. Though mine was going to include buttons that could be acted upon.

On a clear disk you can seek forever

4 (edited by derek 2021-02-23 00:43:06)

Re: Message Dialog with timeout

Hi CDB, EHW,
I was asked for something similar on an old project - confirmation messages when certain forms close (but the code can be attached to any object / event).  Please see the attached (a cut-down example from a larger application) which might be of interest.
Derek.

Post's attachments

Attachment icon information messages.zip 339.75 kb, 427 downloads since 2021-02-22