Two Issues

One issue related to drag and drop is that the user needs to see the target to drag data to it. At the time of writing, however, OLE does not itself define a way to bring covered windows to the foreground during a drag-and-drop operation—end users have to arrange windows manually.

An issue for which OLE does provide a solution arises when a target window is visible but the location in that target where the end user would like to drop the data is not visible. If DoDragDrop is eating the keyboard messages and has the mouse capture, how can the user cause the target window to scroll? (Obviously the target cannot simply assume that if the mouse is off the edge of a particular window, the window should scroll in that direction.) The target, not having the mouse capture, would never see the mouse messages that do this. Even if the target could get the messages, it would mean that every running target would be wildly scrolling in the direction of the mouse! Although this would conform to the second law of thermodynamics, entropy is not user friendly.1

OLE's solution defines a small inset region inside each document window, usually on the order of 11 pixels, as shown in Figure 13-6. If the end user holds the mouse in this region for an appropriate period of time (about 50 ms), the target then scrolls the contents of the window in the direction of the mouse at a rate of one scroll every 50 ms. Scrolling ends when the mouse moves out of the inset region.

Figure 13-6.

The inset region within a target window.

The initial delay before scrolling allows the user to pass the mouse over the inset region without causing any scrolling—in other words, moving the mouse around the screen doesn't cause all potential targets to jump around. Usability testing has shown 50 ms to be about the right delay, 11 pixels to be the right size for the inset region, and 50 ms to be the right scroll rate. These values are defined as the WIN.INI settings DragScrollDelay, DragScrollInset, and DragScrollInterval under the [windows] section. OLE defines the default values with the symbols DD_DEFSCROLLDELAY, DD_DEFSCROLLINSET, and DD_DEFSCROLLINTERVAL.

1OK, OK, so you didn't take thermodynamics in college. The law states that the amount of entropy, S (disorder, chaos), in the universe is increasing—that is, DS > 0.