Solved

Showing autohiding form and blink it in the the taskbar

Posted on 2004-08-16
3
309 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

929 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now