How To Use the System Color on ScrollBars Under Windows NT (244236)
The information in this article applies to:
- Microsoft Visual Basic Learning Edition for Windows 6.0
- Microsoft Visual Basic Professional Edition for Windows 6.0
- Microsoft Visual Basic Enterprise Edition for Windows 6.0
This article was previously published under Q244236 SUMMARY
The background color of the horizontal and vertical scrollbar controls is white under Microsoft Windows NT, while the system color is used under Microsoft Windows 9.x. To use the system color on Windows NT, it is necessary to subclass the form to prevent the WM_CTLCOLORSCROLBAR windows message from being processed by the default windows procedure (WindowProc) of the form.
WARNING: Failure to unhook a window before its imminent destruction results in application errors, Invalid Page Faults, and data loss. This is due to the fact that the new WindowProc function being pointed to no longer exists, but the window has not been notified of the change. Always unhook the sub-classed window upon unloading the sub-classed form or exiting the application. This is especially important while debugging an application that uses this technique within the Microsoft Visual Basic Development Environment (IDE). Pressing the END button or selecting END from the Run menu without unhooking can cause an Invalid Page Fault and close Microsoft Visual Basic.
REFERENCES168795 How To Hook Into a Window's Messages Using AddressOf
Modification Type: | Minor | Last Reviewed: | 7/13/2004 |
---|
Keywords: | kbAPI kbColor kbCtrl kbhowto kbScrollBar KB244236 |
---|
|