I am writing a chat in Delphi using the client <-> server <-> client scheme. The task is as follows: you need to make the application blink when it is minimized and there is a new message , and only in this case. The problem is the same: the application does not blink. In neither case. Here is the code (Receiving a new message and turning on the blink timer (minimized is a global variable, the main operation with which in Timer4)
procedure TForm2.ClientSocket1Read(Sender: TObject; Socket: TCustomWinSocket); begin begin if minimized = 0 then Timer3.Enabled := False else Timer3.Enabled := True; Listbox1.Items.Add(Socket.ReceiveText); end; end;
Timer3:
procedure TForm2.Timer3Timer(Sender: TObject); var i:integer; begin if minimized = 0 then begin Timer3.Enabled := False; end; FlashWindow(Handle, True); FlashWindow(Application.Handle, True); end;
Timer4:
procedure TForm2.Timer4Timer(Sender: TObject); begin if IsIconic(Application.Handle) then begin minimized := 1; end else begin minimized := 0; end; end;
Application.MainFormOnTaskbar
property and, depending on this, trigger the blinking or Form2.Handle or Application.Handle. - kami