HOWTO: Create a Nonblinking Caret
ID: Q74607
|
The information in this article applies to:
-
Microsoft Win32 Software Development Kit (SDK)
-
Microsoft Windows Software Development Kit (SDK) versions 3.0, 3.1
SUMMARY
The Microsoft Windows graphical environment is designed to provide a
blinking caret. However, using a timer and the SetCaretBlinkTime()
function, an application can "trick" the caret into not blinking.
MORE INFORMATION
Although Windows is designed to blink the caret at a specified interval, a
timer function and SetCaretBlinkTime() can be used to prevent Windows from
turning the caret off by following these three steps:
- Call SetCaretBlinkTime(10000), which instructs Windows to blink the
caret every 10,000 milliseconds (10 seconds). This results in a
"round-trip" time of 20 seconds to go from OFF to ON and back to
OFF (or vice versa).
- Create a timer, using SetTimer(), specifying a timer procedure and a
5,000 millisecond interval between timer ticks.
- In the timer procedure, call SetCaretBlinkTime(10000). This resets
the timer in Windows that controls the caret blink.
When an application implements this procedure, Windows never removes the
caret from the screen, and the caret does not blink.
Additional query words:
WIN16SDK
Keywords : kbCaret kbNTOS kbGrpUser kbWinOS
Version :
Platform :
Issue type : kbhowto
Last Reviewed: March 7, 1999