How To Create a Flashing Title Bar on a Visual Basic FormLast reviewed: September 24, 1996Article ID: Q147815 |
The information in this article applies to:
SUMMARYWhen calling a Windows API function call, you can create a flashing window title bar on the present form or any other form for which you know the handle.
MORE INFORMATIONVisual Basic for Windows has the ability to flash the title bar on any form if you can get the handle to that form. The function FlashWindow flashes the specified window once. Flashing a window means changing the appearance of its caption bar, as if the window were changing from inactive to active status, or vice versa. (An inactive caption bar changes to an active caption bar; an active caption bar changes to an inactive caption bar.) Typically, a window is flashed to inform the user that the window requires attention when that window does not currently have the input focus. The function FlashWindow is defined as
FlashWindow(hWnd, bInvert)where:
hWnd - Identifies the window to be flashed. The window can be either open or iconic. bInvert - Specifies whether the window is to be flashed or returned to its original state. The window is flashed from one state to the other if the bInvert parameter is nonzero. If the bInvert parameter is zero, the window is returned to its original state (either active or inactive).FlashWindow returns a value that specifies the window's state before the call to the FlashWindow function. It is nonzero if the window was active before the call; otherwise, it is zero. When using FlashWindow, it is a good design practice to set the flash rate equal to that of the caret rate. The caret blink rate can be found by using the GetCaretBlinkTime function. GetCaretBlinkTime returns the elapsed time, in milliseconds, required to cause the caret to blink.
Step-by-Step ExampleThe following section describes how to flash a form while that form does not have the focus:
|
Additional reference words: 4.00 vb4win vb4all
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |