I have a Delphi 6 Pro application that does certain things when the application is minimized. I do my work in the OnMinimize() event that belongs to a TApplicationEvents component. It works great when the Minimize button on the main window's control box is used, however, when the Windows XP Show Desktop button is used to minimize all active applications the OnMinimize() event is not triggered. Is there a way to fix this or am I going to have to do something messy in the main WndProc()?
-- roschler
Add
protected
{ Private declarations }
procedure WMSize(var Message: TWMSize); message WM_SIZE;
where
procedure TForm1.WMSize(var Message: TWMSize);
begin
if Message.SizeType = SIZE_MINIMIZED then
beep;
end;
Alternatively, of course, you can just do
protected
{ Private declarations }
procedure WndProc(var Message: TMessage); override;
where
procedure TForm1.WndProc(var Message: TMessage);
begin
inherited;
case Message.Msg of
WM_SIZE:
if Message.WParam = SIZE_MINIMIZED then
beep;
end;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With