John Dammeyer wrote:
> I have saved the current screen cursor and changed it to an hourglass.  I
> then do some extensive processing ultimately building a series of pdf pages
> stored to disk.  This can take up to 15 seconds.  The problem is that the
> screen's cursor doesn't change to an hourglass.  What do I call inside the
> function to get the screen to repaint.
> 
> I've tried self.paint and self.invalidate both which I believe just tell
> windows that the next time it feels like it that the form should be
> repainted and the cursor updated.  

The cursor image is not part of the form image.

> There must be someway to tell Windows to do this.  Suggestions?

Screen.Cursor really doesn't control the cursor for the entire screen. 
It only affects the cursor while it's positioned over one of your 
program's forms.

Windows decides what cursor to display by asking your forms what to 
show. It does that by sending a message. If your program truly is busy 
generating files, then it probably isn't processing messages, and so 
Windows's requests go unanswered until you're finished generating the files.

The best solution to this is to generate the files in a separate thread. 
That way, your UI thread can continue processing messages as usual. This 
includes cursor messages as well as painting messages. It also includes 
messages sent when the user clicks the "Cancel" button to stop 
processing the files.

The lesser solution is to occasionally call Application.ProcessMessages 
to let your program catch up with whatever's been sent recently.

-- 
Rob
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi

Reply via email to