Delphi and Kylix

Moderators: pritaeas
Number of threads: 7244
Number of posts: 19051

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
How can I make a system tray flash Posted by Development on 4 May 2004 at 12:04 PM
hey I am trying to make it so when my program is minimized it will flash on system can anyone help me?
Slewis
Report
Re: How can I make a system tray flash Posted by Manning on 4 May 2004 at 12:58 PM
: hey I am trying to make it so when my program is minimized it will flash on system can anyone help me?

Flash on the task bar, or in the system tray? If it's in the task bar, there is an API call for that. I don't know it off-hand though.

If it's in the system tray, then just have a timer change the icon of the system tray component between your programs icon and something else (maybe no icon). If you look, you could probably find a system tray component that has flash capability built in.
Report
Re: How can I make a system tray flash Posted by Development on 4 May 2004 at 8:40 PM
This message was edited by Development at 2004-5-4 22:59:15

I dont mean that I have icon on taskbar.

I just like it to flash when minimized like on yahoo when sum one sends a message to you and the message window is minimized it flashes untill you click on it to show window how can I do this?

thanks for reading this
Slewis



Report
Re: How can I make a system tray flash Posted by netgert on 4 May 2004 at 11:34 PM
: This message was edited by Development at 2004-5-4 22:59:15

: I dont mean that I have icon on taskbar.
:
: I just like it to flash when minimized like on yahoo when sum one sends a message to you and the message window is minimized it flashes untill you click on it to show window how can I do this?
:
: thanks for reading this
: Slewis
:
:
:
:
dont have yahoo, but for the taskbar there was something like FlashWindow(hwnd) which will make the window button on taskbar to go blue (orange on xp blue theme) and back to normal after second call

NetGert[/italic]


Report
Re: How can I make a system tray flash Posted by mohfa on 6 May 2004 at 11:54 PM
: : This message was edited by Development at 2004-5-4 22:59:15

: : I dont mean that I have icon on taskbar.
: :
: : I just like it to flash when minimized like on yahoo when sum one sends a message to you and the message window is minimized it flashes untill you click on it to show window how can I do this?
: :
: : thanks for reading this
: : Slewis
: :
: :
: :
: :
: dont have yahoo, but for the taskbar there was something like FlashWindow(hwnd) which will make the window button on taskbar to go blue (orange on xp blue theme) and back to normal after second call
:
NetGert[/italic]

:
:ok all what you have to do is : that is a simple unite so use it good luck

// Define FLASHWINFO structure as record type
type
FLASHWINFO = record
cbSize: UINT;
hWnd: HWND;
dwFlags: DWORD;
uCount: UINT;
dwTimeOut: DWORD;
end;
TFlashWInfo = FLASHWINFO;

// Define dwFlags constants
const
FLASHW_STOP = 0;
FLASHW_CAPTION = 1;
FLASHW_TRAY = 2;
FLASHW_ALL = FLASHW_CAPTION or FLASHW_TRAY;
FLASHW_TIMER = 4;
FLASHW_TIMERNOFG = 12;

var
Form1: TForm1;
FWInfo: TFlashWInfo;

// Function declaration for WinAPI call
function FlashWindowEx(var pfwi: FLASHWINFO): BOOL; stdcall;

{...}

implementation

{...}

// Import external function from 'USER32.DLL' with the same name
function FlashWindowEx; external user32 Name 'FlashWindowEx';

procedure TForm1.FormCreate(Sender: TObject);
begin
// Check for API function's availability
if not Assigned(@FlashWindowEx) then
begin
ShowMessage('API Function FlashWindowEx is not present... Exit program!');
Application.Terminate;
end
else
// Set default parameters
with FWInfo do
begin
cbSize := SizeOf(FWInfo); // Size of structure in bytes
hWnd := Form1.Handle; // Main's form handle
dwFlags := FLASHW_ALL; // Flash both caption & task bar
uCount := 10; // Flash 10 times
dwTimeOut := 100; // Timeout is 1/10 second apart
end;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
// Flash on normal state
FlashWindowEx(FWInfo);
end;

procedure TForm1.Button2Click(Sender: TObject);
begin
// Flash on minimized state
WindowState := wsMinimized; // Application.Minimize;
FlashWindowEx(FWInfo);
end;






 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.