Problema com a versão do Windows.
Caros colegas, desenvolvi um sistema em uma máquina com Xp instalado e ao executar o sistema em máquinas com w98 veio a surpresa......um componente que eu peguei na net naum funciona no w98.....como saber pq isto acontece e tentar corrigir isto......
o componenente e o ( JustfyRichEdit ).
segue rotina do componente.
unit JustifyRichEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ComCtrls, RichEdit;
type
TJustifyRichEdit = class(TRichEdit)
private
{ Private declarations }
protected
{ Protected declarations }
public
procedure Justify;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents(´ZyXEL´, [TJustifyRichEdit]);
end;
procedure TJustifyRichEdit.Justify;
const
WM_USER = $400;
EM_EXSETSEL = (WM_USER + 55);
EM_SETTYPOGRAPHYOPTIONS = (WM_USER + 202);
EM_GETTYPOGRAPHYOPTIONS = (WM_USER + 203);
TO_ADVANCEDTYPOGRAPHY = $1;
mZERO = $0;
var x :tparaformat;
L :LongInt;
cp :charrange;
begin
x.cbSize := sizeof(x);
if SelLength = 0 then
begin
cp.cpMin := 0;
cp.cpMax := length(Text);
SendMessage(Handle,EM_EXSETSEL,mZERO,LPARAM(@cp));
end;
L := SendMessageA(Handle,EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY);
if L = 1 then
begin
SendMessageA(Handle, EM_GETTYPOGRAPHYOPTIONS, mZERO, mZERO);
SendMessage(Handle, EM_GETPARAFORMAT, mZERO, LPARAM(@x));
x.dwMask := PFM_ALIGNMENT;
x.wAlignment := PFA_JUSTIFY;
SendMessage(Handle, EM_SETPARAFORMAT, mZERO, lparam(@x));
end;
cp.cpMin := 0;
cp.cpMax := 0;
SendMessage(Handle,EM_EXSETSEL,mZERO,lparam(@cp));
WordWrap := true;
end;
end.
[]´s
Oscar Luiz R. de Oliveira
o componenente e o ( JustfyRichEdit ).
segue rotina do componente.
unit JustifyRichEdit;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls, ComCtrls, RichEdit;
type
TJustifyRichEdit = class(TRichEdit)
private
{ Private declarations }
protected
{ Protected declarations }
public
procedure Justify;
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents(´ZyXEL´, [TJustifyRichEdit]);
end;
procedure TJustifyRichEdit.Justify;
const
WM_USER = $400;
EM_EXSETSEL = (WM_USER + 55);
EM_SETTYPOGRAPHYOPTIONS = (WM_USER + 202);
EM_GETTYPOGRAPHYOPTIONS = (WM_USER + 203);
TO_ADVANCEDTYPOGRAPHY = $1;
mZERO = $0;
var x :tparaformat;
L :LongInt;
cp :charrange;
begin
x.cbSize := sizeof(x);
if SelLength = 0 then
begin
cp.cpMin := 0;
cp.cpMax := length(Text);
SendMessage(Handle,EM_EXSETSEL,mZERO,LPARAM(@cp));
end;
L := SendMessageA(Handle,EM_SETTYPOGRAPHYOPTIONS, TO_ADVANCEDTYPOGRAPHY, TO_ADVANCEDTYPOGRAPHY);
if L = 1 then
begin
SendMessageA(Handle, EM_GETTYPOGRAPHYOPTIONS, mZERO, mZERO);
SendMessage(Handle, EM_GETPARAFORMAT, mZERO, LPARAM(@x));
x.dwMask := PFM_ALIGNMENT;
x.wAlignment := PFA_JUSTIFY;
SendMessage(Handle, EM_SETPARAFORMAT, mZERO, lparam(@x));
end;
cp.cpMin := 0;
cp.cpMax := 0;
SendMessage(Handle,EM_EXSETSEL,mZERO,lparam(@cp));
WordWrap := true;
end;
end.
[]´s
Oscar Luiz R. de Oliveira
Oscarluiz
Curtidas 0
Respostas
Beppe
17/11/2003
O win98 não oferece suporte.
GOSTEI 0
Beppe
17/11/2003
Precisa ter a versão 3.0(no mínimo) do Rich Edit. O 3.0 vem com o 2000, Me e XP.
GOSTEI 0