Important alert: (current site time 7/16/2013 2:01:00 AM EDT)
 

VB icon

***Form Flash***

Email
Submitted on: 6/14/1999
By: Ben Doherty  
Level: Not Given
User Rating: By 14 Users
Compatibility: VB 5.0, VB 6.0
Views: 50638
(About the author)
 
     This code makes your form window flash like Aol's Instant Messanger when it receives a message.
 

Windows API/Global Declarations:

Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
'**************************************
'Windows API/Global Declarations for :***Form Flash***
'**************************************
private declare function FlashWindow lib "user32" alias "FlashWindow" (ByVal hWnd as long, ByVal bInvert as long) as long
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: ***Form Flash***
' Description:This code makes your form window flash like Aol's Instant Messanger when it receives a message.
' By: Ben Doherty
'
' Assumes:make a timer and set the interval to 3000.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=2090&lngWId=1'for details.'**************************************

Private sub timer1_timer()
dim nReturnValue as integer
nReturnValue = FlashWindow(form1.hWnd, true)
end sub


Other 4 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Not Given category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
6/15/1999 12:09:00 PMJustice

Cool little snippet of code. It's better if you set the Timer1.interval to something less than 3000 milliseconds, though. If not, it blinks VERY slow.
(If this comment was disrespectful, please report it.)

 
8/9/1999 3:40:00 PMFman19

um, what is the world directions thingy? Please email me the answer
(If this comment was disrespectful, please report it.)

 
12/25/1999 4:24:06 AMMunavvar

Excellent Concept..
(If this comment was disrespectful, please report it.)

 
1/20/2000 10:10:33 PMytian

Thank you ... it helps a lot.
(If this comment was disrespectful, please report it.)

 
1/2/2002 6:21:01 AMHenrik

Hi, I am getting a
(If this comment was disrespectful, please report it.)

 
1/2/2002 6:22:37 AMHenrik

Hi, I am getting a Runtime error 6 Overflow. Can you explain me why ?
(If this comment was disrespectful, please report it.)

 
6/8/2002 10:16:05 AMsham

Excellent...! I think it's a simple code to do it.
(If this comment was disrespectful, please report it.)

 
7/17/2002 4:28:33 AMBrandon 9 13

i had to fix it up a little. the FlashWindow should be declared like this Public Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, ByVal bInvert As Boolean) As Long
(If this comment was disrespectful, please report it.)

 
7/23/2002 12:51:26 AMSan

No good it's overflow.
(If this comment was disrespectful, please report it.)

 
7/23/2002 1:00:15 AMSan

The "Dim nReturnValue as Integer" should be "Dim nReturnValue as Long"

(If this comment was disrespectful, please report it.)

 
8/9/2002 4:49:16 AMMassKiller

That's very useful... Thank you!
(If this comment was disrespectful, please report it.)

 
9/25/2002 3:21:37 PMFilb

Nice code!
(If this comment was disrespectful, please report it.)

 
1/19/2003 3:55:25 AM

Great idea!!!
To sum it up do put this in your form code:
Private Sub timer1_timer()
Dim nReturnValue as Integer
nReturnValue = FlashWindow(form1.hWnd, true)
End Sub

And this in a module:
Public Declare Function FlashWindow Lib
(If this comment was disrespectful, please report it.)

 
6/6/2004 10:08:31 PM

it is very good
(If this comment was disrespectful, please report it.)

 
2/14/2005 8:51:30 AM

i keep on getting error on that code
(If this comment was disrespectful, please report it.)

 
9/25/2006 12:52:31 AMmartin

helpfull
(If this comment was disrespectful, please report it.)

 
5/8/2007 5:53:44 AMRandolf

the variable nReturnValue is overflowing, might use long instead ^_^ nice snippet anyway..thank you!!!
(If this comment was disrespectful, please report it.)

 
3/15/2010 10:13:43 PMlsh

nice code
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.