Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get rid of this? (Looks like the form version of mouse trails)

Tags:

forms

delphi

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?

like image 440
Dian Avatar asked Jul 22 '10 07:07

Dian


2 Answers

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.)

like image 95
TheBlastOne Avatar answered Nov 10 '22 00:11

TheBlastOne


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;
like image 30
Trinidad Avatar answered Nov 09 '22 22:11

Trinidad