Solved

Showing autohiding form and blink it in the the taskbar

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

747 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

8 Experts available now in Live!

Get 1:1 Help Now