I have cursor shaped forms (functioning as actual cursors). Whenever I drag it makes what looks like mouse trails. The red and white stuff. See the little red arrow on the upper heart and the little white arrow on the lowest heart? Those are my cursor shaped forms, it's a picture on a tiny form (I cut regions so that the form will be shaped like the picture on it). Those are created in the MainUnit (which I minimized).
form trails http://img10.imageshack.us/img10/9718/mousetrails.png
When I click and hold, it makes these trails... hovering over those will erase it. How do I get rid of this behavior?
And I can get rid of these by refreshing but if I refresh everytime a mouse moves there is terrible flickering. My current solution is refreshing whenever there is a click, but I want a solution that will get rid of the behavior and not just erase it after it gets drawn.
Okay, I tried it without the wallpaper. No wallpaper http://img830.imageshack.us/img830/6595/nowallpaper.png It's the same effect inside folders too.
Through a little more experimenting. I've discovered that it wasn't the (cursor) form at all. And it wasn't the code. I tried moving (randomly) forms (with a timer using it's left and top properties). And it seemed okay at first but when I click and hold on the desktop. This happens: Form Trails http://img411.imageshack.us/img411/7409/formg.png Soooooo. Any suggestions as to what I should do to avoid/minimize/control this?
Update your video driver.
Or, as a shortcut, fallback to stock plain vanilla (i.e. standard Windows-supplied) VGA drivers, without changing anything else. If the symptom then persists, the problem is not in the driver, and you can forget about the driver update. (This shortcut is a shortcut because you often cannot easily undo a driver update, just in case you'd want.)
Based upon Sertac Akyuz comment and http://msdn.microsoft.com/en-us/library/dd145034(VS.85).aspx, try the following:
function TForm1.WaitUntilDesktopUnlocks: Boolean;
var
desktopUnlocked: Boolean;
begin
desktopUnlocked:= False;
while not desktopUnlocked do begin
desktopUnlocked:= LockWindowUpdate(Self.Handle);
LockWindowUpdate(0);
end;
end;
procedure TForm1.DoMoveCursorWindow() // method called to move the window each step
begin
WaitUntilDesktopUnlocks;
Self.Left := Self.Left + 1;
Self.Top := Self.Top + 1;
end;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With