SAMPLE: Using Blinking Text in an ApplicationLast reviewed: February 15, 1996Article ID: Q11787 |
The information in this article applies to:
SUMMARYIt is possible to create blinking text in a Windows-based application. Because there are no character attributes similar to the normal MS-DOS text environment, the application must repeatedly paint the screen to implement the flash. This article, and an accompanying file in the Microsoft Software Library, demonstrate how this is done.
MORE INFORMATIONA timer is used to determine the rate at which the text flashes. Timer messages are processed by inverting the appropriate area in the window using the DSTINVERT action of the PatBlt function. The second time that the PatBlt function is called, the text returns to its original state. Alternatively, the PATINVERT action of the PatBlt function may be used. To use this method, an appropriate brush must be selected into the display context as the current pattern. This method requires more work, however, it is more flexible. The rate at which the text blinks can be set to match the cursor blink time set in the Control Panel. To do this, the following code should be run when the application starts and in response to WM_WININICHANGE messages:
nRate = GetProfileInt( (LPSTR)"windows", /* heading in [] */ (LPSTR)"CursorBlinkRate", /* string to match */ 550); /* default value */Be sure to delete the timer when the application terminates. There is a sample program in the Microsoft Software Library named BLINK that uses this technique to demonstrate blinking text. Download BLINK.EXE, a self-extracting file, from the Microsoft Software Library (MSL) on the following services: |
Additional reference words: 3.00 3.10 3.50 4.00 95 softlib BLINK.EXE
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |