Solved

Showing autohiding form and blink it in the the taskbar

Posted on 2004-08-16
3
314 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing problem 2 125
Delphi Firemonkey: if the Sms contain special characters it won't send it 3 84
Browsing a TTreeView in Delphi 5 50
QuickReport, Delphi, Shape 12 49
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

710 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