473,554 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1781
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.Ru ntime.InteropSe rvices.Marshal. SizeOf(fi);
fi.hwnd = Handle;
fi.dwFlags = FLASHW_TRAY;
fi.uCount = 3;
fi.dwTimeout = 0;
FlashWindowEx(r ef fi);
}

[DllImport("user 32.dll")]
[return: MarshalAs(Unman agedType.Bool)]
static extern bool FlashWindowEx(r ef FLASHWINFO pwfi);

[StructLayout(La youtKind.Sequen tial)]
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_TIMERNOF G = 12;
Aug 19 '08 #2
Import the windows user32 dll function:

[DllImport("user 32.dll")]
static extern bool FlashWindow(Int Ptr hwnd, bool bInvert);
then in a method put:
FlashWindow(thi s.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
2147
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 to print the variables (input) on the screen , but I can't make it work. I think I have to do something with an array, but don't know what. I've...
10
2727
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 background and a few reports. Quite often I lament at the limitations of using forms, in particular how to make something that looks "stylish". This...
2
2088
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. Imagine using this application to link thousands of executables and trying to use the machine while thousands of temporary DOS boxes appear and...
11
16548
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. So my header div is defined at top:0; height:40px , my footer is defined as bottom:0; height:40px and the content is defined as...
3
9490
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), but too big for many other screens, laptops etc. Is there a way to maybe add a line to the index.html that will automatically adapt the dimensions of...
3
4975
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. http://g.bach.home.insightbb.com/movies.html I have a page set up on my website to view videos from various sites by creating html pages and creating links to view them...
1
2332
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 install some plugins to use XPATH? <html> <head> <title>SilverLine </title> <link rel="stylesheet" href="example.css" TYPE="text/css"...
2
1663
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 ID #2 (or any ID over 1) and input that information into my dynamic page. No matter what ID i type, or even if I neglect to type in an ID to begin...
9
2089
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 10.5 http://www.screencast.com/t/wgztYUrdN (Video) http://www.jameswmann.com/music.htm (The actual page) HTML
0
7573
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7778
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7857
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6114
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5135
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3538
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3525
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1992
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.