Thanks Jez. Your suggestions seems to work except for the last thing. As I
move the cursor over windows, how do I repaint windows that no longer have
the cursor over them? Is there a way to get all the windows to repaint?
Disposing of the DC did not seem to do this?
Releasing the DC wouldn't force a redraw. If you want to redraw a window, a
couple of functions in Win32::GUI should help, InvalidateRect and Redraw.
Both functions can be called as functions with the first parm being the
window handle (behind the scenes, InvalidateRect calls the MS API
InvalidateRect while Redraw calls RedrawWindow just in case you wanted to
look them up).
It should be relatively simple logic to redraw a window once the cursor has
left it, although I think in some cases you might have to do a full refresh
with:
Win32::GUI::InvalidateRect(0,0);
Adding this to your example seems to work - although I think your coordinate
system with the cursor is slightly out of sync?
Cheers,
jez.