[Lazarus] Catching minimize on windows

Søren Ager soren at agerklanen.dk
Fri Jul 4 10:43:45 CEST 2008


Luca Olivetti wrote:

> En/na Søren Ager ha escrit:
> 
>> Now I just need to figure out why Hide or Visible:=false does not remove 
>> the window from the task bar.
> 
> Maybe you should use the ShowInTaskbar form property

I read somewhere that ShowInTaskbar is only used during startup of the 
application after that it is read only. Anyway it did not work either way.

After a lot of Googleing I finally found the answer:

procedure TMainForm.MinimizeMe(Sender: TObject);
var
   OwnerWnd : HWnd;
begin
   OwnerWnd:=GetWindow(Handle,GW_OWNER);
   ShowWindow(OwnerWnd,SW_HIDE);
end;



Take care,
   Søren






More information about the Lazarus mailing list