destruir handles
A situação é a seguinte tenho um componente TIAsemiPanel que uso como semi-transparente em cima de TJvPanel. Eu crio o TIAsemiPanel em tempo de execução uma vez e vou mudando o parente a medida que dou o click em um TJvPanel ... que são varios. Ou seja clico no TJvPanel retiro o parente do anterior clicado e crio o parent para o que foi clicado.
O problema é que quando crio o parent neste componente ele cria um outro handle para o TIAsemiPanel o que complica na hora de finalizar a aplicação. Tenho que deletar todos os handles.
[b:304e366fa3]Linha que cria o handle no TIAsemiPanel.[/b:304e366fa3]
[b:304e366fa3]Referencia ao inherited da procedure anterior dentro do Controls[/b:304e366fa3]
Como deletar os handles?
if LastControl <> nil then UltimoControle.RemoveComponent(AlertPanel); TJvPanel(sender).InsertComponent(AlertPanel); ChangePropAlertPanel(TJvPanel(sender).Top , TJvPanel(sender).Left, TJvPanel(sender).Height , TJvPanel(sender).Width , True,TJvPanel(sender)); LastControl:=TJvPanel(sender);
O problema é que quando crio o parent neste componente ele cria um outro handle para o TIAsemiPanel o que complica na hora de finalizar a aplicação. Tenho que deletar todos os handles.
[b:304e366fa3]Linha que cria o handle no TIAsemiPanel.[/b:304e366fa3]
procedure TIAsemiPanel.CreateHandle; begin [b]inherited CreateHandle;[/b] ATimer := TIApanelSemiTimer.Create(True); ATimer.Dt:=2000; ATimer.AHandle:=self.handle; ATimer.Resume; DefinePolys; DrawOnIt; end;
[b:304e366fa3]Referencia ao inherited da procedure anterior dentro do Controls[/b:304e366fa3]
procedure TWinControl.CreateHandle; var I: Integer; begin if FHandle = 0 then begin CreateWnd; SetProp(FHandle, MakeIntAtom(ControlAtom), THandle(Self)); SetProp(FHandle, MakeIntAtom(WindowAtom), THandle(Self)); if Parent <> nil then SetWindowPos(FHandle, Parent.PrecedingWindow(Self), 0, 0, 0, 0, SWP_NOMOVE + SWP_NOSIZE + SWP_NOACTIVATE); for I := 0 to ControlCount - 1 do Controls[I].UpdateAnchorRules; end; end;
Como deletar os handles?
Pedroso
Curtidas 0
Respostas
Pedroso
29/04/2009
Alguem sabe?
GOSTEI 0
Pedroso
29/04/2009
sobe
GOSTEI 0
Pedroso
29/04/2009
sobe
GOSTEI 0
Pedroso
29/04/2009
Muito bem .... problema resolvido......
Retirei o RemoveComponent() e o InsertComponent().
if LastControl <> nil then UltimoControle.RemoveComponent(AlertPanel); TJvPanel(sender).InsertComponent(AlertPanel); ChangePropAlertPanel(TJvPanel(sender).Top , TJvPanel(sender).Left, TJvPanel(sender).Height , TJvPanel(sender).Width , True,TJvPanel(sender)); LastControl:=TJvPanel(sender);
Retirei o RemoveComponent() e o InsertComponent().
GOSTEI 0