Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Catch user's attention with a flashing caption

Total Hit ( 3341)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


If you want to draw user's attention but you don't want to force the form to move to the foreground, you can simply flash its caption (and its icon in the taskbar), using the FlashWindow API function. To do so, just add a Timer with a suitable Interval property (for example, 1000 milliseconds) and then add this code to the form module:

Click here to copy the following block
Private Declare Function FlashWindow Lib "user32" (ByVal hWnd As Long, _
  ByVal bInvert As Long) As Long

Private Sub cmdStartFlashing_Click()
  ' start the flashing by enabling the timer
  Timer1.Interval = 1000
End Sub

Private Sub cmdStopFlashing_Click()
  ' disable the timer to stop the flashing, and restore regular caption
  Timer1.Interval = 0
  FlashWindow Me.hWnd, 0
End Sub

Private Sub Timer1_Timer()
  ' toggle the caption status
  FlashWindow Me.hWnd, 1
End Sub

The second argument to FlashWindow must be zero to restore the standard state of the caption (that is, the activate state), while a non-zero value toggles from enabled to disabled state, and vice versa.


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.