Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Showing autohiding form and blink it in the the taskbar

Posted on 2004-08-16
3
Medium Priority
?
319 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 1000 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

971 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