Solved

Showing autohiding form and blink it in the the taskbar

Posted on 2004-08-16
3
312 Views
Last Modified: 2010-04-05

I need to execute the method Show, autohiding the form and blinking the task bar (like receiving new message into msn)

0
Comment
Question by:faustomen
3 Comments
 
LVL 2

Expert Comment

by:beermequik
ID: 11815091
Use the windows API
FlashWindow...
and
ShowWindow...

when you want to minimize...
ShowWindow(Application.handle, SW_MINIMIZE);

The API only flashes it once so...

To flash repeatedly use a Timer Object
TTimer.OnTimer..
FlashWindow(Application.handle, true);


to stop flashing

Form.onActivate:
TTimer.active := false;

0
 
LVL 12

Accepted Solution

by:
esoftbg earned 250 total points
ID: 11815354
unit UnitBlink;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Buttons, ExtCtrls, StdCtrls;

type
  TFormBlink = class(TForm)
    Timer: TTimer;
    procedure FormCreate(Sender: TObject);
    procedure TimerTimer(Sender: TObject);
  private   { Private declarations }
    ITimer:   Int64;
  public    { Public declarations }
  end;

var
  FormBlink: TFormBlink;

implementation

{$R *.dfm}

procedure TFormBlink.FormCreate(Sender: TObject);
begin
  ITimer := 0;
  Timer.Enabled := True;
end;

procedure TFormBlink.TimerTimer(Sender: TObject);
begin
  Inc(ITimer);
  if (ITimer>0) then
  begin
    FlashWindow(Application.Handle, True);
    if (ITimer=1) then
      ShowWindow(Application.Handle, SW_MINIMIZE);
    Application.ShowMainForm := False;
    ShowWindow(Application.MainForm.Handle, SW_HIDE);
    Timer.Interval := 320;
  end;
end;

end.
0
 
LVL 2

Expert Comment

by:DarkCore_
ID: 11818128
To flash the Window use better FlashWindowEx, implemented in Windows 98, you don't need timer.

Edu
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question