Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / January 2007

Tip: Looking for answers? Try searching our database.

How do I stop FlashWindowEx when me.handle gets focus?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Miller - 12 Jan 2007 13:50 GMT
Hi....

I'm using FlashWindowEx to flash the taskbar and titlebar when my processes
are done.
I set the number of flashes to 5.  But when the user returns to the window
the flashing
continues until all 5 flashes complete.

How do you stop the flashing once the user returns to the app.?  (Code
Below)

Thanks for any help,
Marc Miller

   Public Structure FLASHWINFO
       Public cbSize As Int32
       Public hwnd As IntPtr
       Public dwFlags As Int32
       Public uCount As Int32
       Public dwTimeout As Int32
   End Structure

   Private Declare Function FlashWindowEx Lib "user32.dll" (ByRef pfwi As
FLASHWINFO) As Int32

   Private Const FLASHW_CAPTION As Int32 = &H1
   Private Const FLASHW_TRAY As Int32 = &H2
   Private Const FLASHW_ALL As Int32 = (FLASHW_CAPTION Or FLASHW_TRAY)

   Public Sub FlashNow(ByVal sender As System.Object, ByVal e As
System.EventArgs, ByVal iTimes As Integer)

       Dim flash As New FLASHWINFO
       flash.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(flash)
'/// size of structure in bytes
       flash.hwnd = Me.Handle '/// Handle to the window to be flashed
       flash.dwFlags = FLASHW_ALL '/// to flash both the caption bar + the
tray
       flash.uCount = iTimes '/// the number of flashes
       flash.dwTimeout = 1000 '/// speed of flashes in MilliSeconds ( can
be left out )
       '/// flash the window you have specified the handle for...
       FlashWindowEx(flash)

   End Sub
Bryan Phillips - 15 Jan 2007 00:34 GMT
Call FlashWindowEx again using FLASHW_STOP as the value for dwFlags.

Here is a declaration for FLASHW_STOP:

Private Const FLASHW_STOP As Int32 = &H0

--
Bryan Phillips
MCSD, MCDBA, MCSE
Blog:  http://bphillips76.spaces.live.com

> Hi....
>
[quoted text clipped - 41 lines]
>
>     End Sub

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.