Topic: Is it poossible to auto-close a MessageBox?

Hi Dmitry,  Is it possible, either by script or by extra parameters passed to the MessageBox procedure/function to have the actual message box that is displayed, to automatically close after a period of time like (e.g.10 seconds) with no user input?  i.e. like a timeout functionality so that apps can be run unattended?
This would also be a useful function to have for error message popups as well. Cheers.

Dennis

Re: Is it poossible to auto-close a MessageBox?

Hello,


Please, download latest beta version 1.49
https://www.dropbox.com/s/bsk683d3yf6jv … 9.zip?dl=0


I added function MessageDlgTimeOut(Msg, Caption: string; Flags: integer; Milliseconds: integer): integer;
example of use:

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
var
    iResult: integer;
begin
    iResult := MessageDlgTimeOut('Hello', 'Caption', MB_YESNO+MB_ICONINFORMATION, 2000); // 2 seconds
    if iResult = IDTIMEOUT then ShowMessage('TimeOut');
    if iResult = IDYES then ShowMessage('Yes');
    if iResult = IDNO then ShowMessage('No');
end;

also you can use other buttons and icons for the message dialog:


Buttons:

MB_OK
MB_YESNO
MB_YESNOCANCEL
MB_OKCANCEL
MB_ABORTRETRYIGNORE
MB_HELP
MB_RETRYCANCEL

Icons:

MB_ICONEXCLAMATION
MB_ICONWARNING
MB_ICONINFORMATION
MB_ICONASTERISK
MB_ICONQUESTION
MB_ICONSTOP
MB_ICONERROR
MB_ICONHAND

Results:

IDTIMEOUT
IDYES
IDOK
IDNO
IDABORT
IDCANCEL
IDCONTINUE
IDIGNORE
IDRETRY
IDTRYAGAIN
Dmitry.

Re: Is it poossible to auto-close a MessageBox?

Wow! Again I am amazed at your responsiveness, both in terms of replying and in implementing requested features.
This is very much appreciated. Thank you.

Dennis