TScrollFixTimer Object
Methods

Unit
IB_Grid

Declaration
TScrollFixTimer = class(TTimer)

Description
TScrollFixTimer. Due to some shortcomings with MS's scrolling processes it is possible that any scroll that results in message processing (eg. an event or callback that calls "Application.ProcessMessages") may lead to the loss of the WM_LBUTTONUP message that signals the end of scrolling. This can result in various problems, including never-ending scrolling.

Because scrolling an IB_Grid is likely to result in this situation we setup a global timer function to which we can queue WM_LBUTTONUP messages back to the message queue.

Note: The messages must be queued by timer and not by PostMessage, in order to avoid an infinite loop of ProcessMessages calls.

Note 2: This timer is not specifically tied to the IB_Grid component so it can be used by any control that experiences this problem. A single global instance of this timer is instantiated in this unit called MessageRequeueTimer. To use this timer simply call "MessageRequeueTimer.QueueMessage( Handle, Msg )" with the window handle and message that you want requeued (usually the control window handle and WM_LBUTTONUP message for scroll problems). The object will take a copy of the message to be queued back to the application next time the timer is initiated. (The class itself takes care to enable/disable the the timer according to whether any messages are queued.)

Refer to Microsoft Knowledgebase item Q102552 for more detail on the scroll problem this was built to circumvent.

Introduced Public Methods
Create
Destroy
QueueMessage