const IDTIMEDOUT = 32000;
function MessageBoxTimeoutA(hWnd: Cardinal; lpText, lpCaption: PChar; uType, wLanguageId, dwMilliseconds: Cardinal): Integer; stdcall external 'user32';
procedure TForm1.Button1Click(Sender: TObject);
begin
case MessageBoxTimeoutA(0, 'Este mensaje desaparecera en 3 segundos...', 'MessageBoxTimeoutA', MB_ICONINFORMATION or MB_YESNOCANCEL, 0, 3000) of
IDYES: Caption := 'Si';
IDNO: Caption := 'No';
IDCANCEL: Caption := 'Cencelado';
IDTIMEDOUT: Caption := 'Tiempo de espera agotado!';
end;
end;