Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 02-08-2017
Avatar de Soa Pelaez
Soa Pelaez Soa Pelaez is offline
Miembro
 
Registrado: nov 2015
Posts: 133
Poder: 9
Soa Pelaez Va por buen camino
[SOLUCIONADO] MessageBoxTimeout No me muestra los mensajes completos

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
Responder Con Cita
  #2  
Antiguo 02-08-2017
Avatar de Soa Pelaez
Soa Pelaez Soa Pelaez is offline
Miembro
 
Registrado: nov 2015
Posts: 133
Poder: 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
  #3  
Antiguo 02-08-2017
Avatar de MAXIUM
MAXIUM MAXIUM is offline
Miembro
 
Registrado: may 2005
Posts: 1.488
Poder: 20
MAXIUM Va camino a la fama
Gracias por el aporte. Es importante dar la solución si es encontrada por si mismo si no se logra responder la pregunta.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Copiar directorios completos macu1975 API de Windows 9 27-12-2011 23:32:29
Programas (CxCobrar y CxPagar) Completos Caral Varios 10 27-12-2010 23:12:41
email yahoo, no muestra contenido..muestra todo menos contenido. sakuragi Linux 5 29-02-2008 18:11:27
Solucionado...Outlook + adjuntar mensajes cirilungol Internet 2 26-05-2006 11:45:41


La franja horaria es GMT +2. Ahora son las 00:01:27.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi