473,394 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Using C Sharp to make application flash at bottom of screen?

At the bottom of a windows screen are those rectangular boxes for each
application. Sometimes they flash to alert the user that somethign has
happened. How can I make my own C Sharp applications flash?
Aug 19 '08 #1
3 1775
use the following code in your form class .... or change it as needed.

-J-

private void FlashIt()
{
FLASHWINFO fi = new FLASHWINFO();
fi.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeO f(fi);
fi.hwnd = Handle;
fi.dwFlags = FLASHW_TRAY;
fi.uCount = 3;
fi.dwTimeout = 0;
FlashWindowEx(ref fi);
}

[DllImport("user32.dll")]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool FlashWindowEx(ref FLASHWINFO pwfi);

[StructLayout(LayoutKind.Sequential)]
public struct FLASHWINFO
{
public UInt32 cbSize;
public IntPtr hwnd;
public UInt32 dwFlags;
public UInt32 uCount;
public UInt32 dwTimeout;
}

//Stop flashing. The system restores the window to its original state.
public const UInt32 FLASHW_STOP = 0;
//Flash the window caption.
public const UInt32 FLASHW_CAPTION = 1;
//Flash the taskbar button.
public const UInt32 FLASHW_TRAY = 2;
//Flash both the window caption and taskbar button.
//This is equivalent to setting the FLASHW_CAPTION | FLASHW_TRAY flags.
public const UInt32 FLASHW_ALL = 3;
//Flash continuously, until the FLASHW_STOP flag is set.
public const UInt32 FLASHW_TIMER = 4;
//Flash continuously until the window comes to the foreground.
public const UInt32 FLASHW_TIMERNOFG = 12;
Aug 19 '08 #2
Import the windows user32 dll function:

[DllImport("user32.dll")]
static extern bool FlashWindow(IntPtr hwnd, bool bInvert);
then in a method put:
FlashWindow(this.Handle, true);
--
Ciaran O''Donnell
http://wannabedeveloper.spaces.live.com
"Bernard.Mangay" wrote:
At the bottom of a windows screen are those rectangular boxes for each
application. Sometimes they flash to alert the user that somethign has
happened. How can I make my own C Sharp applications flash?
Aug 19 '08 #3
thanks guys!
Aug 19 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Phi | last post by:
Hi there, I've just started learning php and I hope you guys could help me with this problem. I've found a useful pice of code from a book to make a form and I would like to use it. I would like...
10
by: Scott | last post by:
I have written an Access application that our employees use on a daily basis to enter information. It's comprises of a series of forms, a few data integrity check queries that run in the...
2
by: Owen | last post by:
I'm using an application (a Tcl/Tk app) that uses cl.exe to compile code in the background. One very annoying feature is that a DOS box is flashed to the screen and then withdrawn during linking. ...
11
by: Grischa Brockhaus | last post by:
Hi, I'm trying to produce a div layout containing a header on the top with fixed height, a footer on the bottom using fixed height and a content layer using what's left of the browsers window. ...
3
by: prom19 | last post by:
I made my first flash-site, it's based on a top frame that loads the pages and a small bottom frame that doesnt change content. The problem is that the dimensions are fine for my screen (1280X1024),...
3
by: synergy_711 | last post by:
I feel like this should be fairly easy but I have been struggling with this for sometime. I have not been able to find someone who's had the same problem as mine yet. ...
1
by: newToAjax | last post by:
I have created an ajax application which retrievs an xml file and fills in the tab fields on the form.The code works fine in IE while its does not in Mozilla. Can you please let me know if i have to...
2
by: ph33red | last post by:
Hi, I'm having a problem getting my code to pull the appropriate information when I call for it via URL. (example: http://..../.php?id=2). For some reason I can't get it to pull the information for...
9
by: GloStix | last post by:
Okay, when I click the link it dissapears and makes a white space underneath it but the space is clickable. so when you click the space, the link actually works Used Firefox 3.0 RC2 for this. OS X...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.