Encontré el siguiente código en los foros y quice implementarlo en mi proyecto para tener un mensaje que se cierre durante un lapso de tiempo.
Al ejecutarlo el mensaje y el título de la ventan solo me muestra la primer letra y el resto de mensaje no, podrían ayudarme a que se muestre todo el texto del título del mensaje y su contenido.
Muchas gracias.
El código es el siguiente.
Código Delphi
[-]
private
public
end;
const
MB_TIMEDOUT = 32000;
function MessageBoxTimeOut(hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutA(hWnd: HWND; lpText: PChar; lpCaption: PChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
function MessageBoxTimeOutW(hWnd: HWND; lpText: PWideChar; lpCaption: PWideChar;
uType: UINT; wLanguageId: WORD; dwMilliseconds: DWORD): Integer; stdcall;
var
Form1: TForm1;
implementation
{$R *.dfm}
function MessageBoxTimeOut; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutA; external user32 name 'MessageBoxTimeoutA';
function MessageBoxTimeOutW; external user32 name 'MessageBoxTimeoutW';
procedure TForm1.Button1Click(Sender: TObject);
begin
case MessageBoxTimeout(Handle,
'This box will close after 5 seconds.',
'Testing',
MB_SETFOREGROUND OR MB_SYSTEMMODAL OR
MB_ICONINFORMATION OR MB_OKCANCEL,
0,
5000) of
IDOK : ShowMessage('Ok');
IDCANCEL : ShowMessage('Canceled');
MB_TIMEDOUT: ShowMessage('TimedOut');
end;
end