Ver Mensaje Individual
  #2  
Antiguo 02-08-2017
Avatar de Soa Pelaez
Soa Pelaez Soa Pelaez is offline
Miembro
 
Registrado: nov 2015
Posts: 133
Reputación: 9
Soa Pelaez Va por buen camino
Cita:
Empezado por Soa Pelaez Ver Mensaje
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
{ Private declarations }
public
{ Public declarations }
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
Ya encontre el problema en el click del botón debo usar MessageBoxTimeoutW igual ahi queda por si alguien lo necesita muchas gracias.
Responder Con Cita