Disappearing Window Contents while dragging the mouse

We have heard a couple reports of strange behavior in Visual FoxPro if you click on a thumb button in a scrollbar, drag it up or down a little, then pause for 6 seconds or so.

The contents of the window would disappear, leaving a blank editing window.

When you release the mouse, the contents would reappear.

This sounds like a strange behavior, but what’s even stranger is that it was very hard to duplicate the conditions to reproduce it.

Eventually, we could reproduce it sporadically, but if we tried with a debug version of FoxPro or with a debugger attached, it would not reproduce.

So how can we track this behavior down?

We could modify the source code and put a hard coded DebugBreak function at various places, such as the routine to erase the window or the scrollbar routine. When the breakpoint would hit, a dialog would appear asking to attach a debugger.

However, guessing where to put such a breakpoint so that it would be hit only once at the right time didn’t lead very far.

I decided to use an old friend, Spy++ , which comes with Visual Studio. It can display all the messages that are sent to a particular window.

Does this one ever remind me of that editor crashing bug that you ferreted out way back in 98 or so. The bug was based on some strange division remainder of the number of bytes of selected text or something. It rarely happened at all, but when it did you lost all your work in the editor. I could never repro it at will because I didn’t know the “secret”.

So, one day it happened and you came to my office and attached the Debugger to it without the ability to see the source code and instead viewed the Assembler source. Anyway, from there you fixed it and saved a lot of FoxPro programmers a lot of grief.