Board index » delphi » Hourglass on form close after Disabling the form

Hourglass on form close after Disabling the form

Hi
   Does anyone know how to disable a form (the main form) when quitting,
and
setting the cursor to hourglass.  I'm using FileNet Workflo controls and
in
their 32 bit version, the logoff property of their control takes about
15
seconds to log off and so I have to show the Hourglass while it's
logging off.
(which works with
Screen.Cursor = crHourglass;

However, I also want to disable the main form before or after I set the
cursor
(doesn't matter). so that the user can't do anything to the main form,
like
exit the program again.  It so happens, that when the form is disabled,
the
cursor does not change at all.  I even tried some
Application.Processmessages
and it still did not work
TFrmMain.FormClose(sender : TObject); // or something like that
begin
    self.enabled := True;
    Application.ProcessMessages;
    Screen.Cursor := crHourglass;

    Logonoff1.Action := LOGOFF;

end;

and it won't change the cursor to hourglass.  It seems that if the form
that
initiates the cursor change has to be enabled for the cursor to change.
Any
ideas?

Phillip Woon
Woon Technologies
pwoon48...@aol.com

  vcard.vcf
< 1K Download
 

Re:Hourglass on form close after Disabling the form


Quote
>>TFrmMain.FormClose(sender : TObject); // or something like that
>>begin
>>    self.enabled := True;
>>    Application.ProcessMessages;
>>    Screen.Cursor := crHourglass;

>>    Logonoff1.Action := LOGOFF;

>>end;

Try...

TFrmMain.FormClose(sender : TObject); // or something like that
begin
    self.enabled := False;
    Screen.Cursor := crHourglass;
    Application.ProcessMessages;
    Logonoff1.Action := LOGOFF;
end;

===
Bill

Re:Hourglass on form close after Disabling the form


Quote
In article <34E1D2AA.92822...@med.osd.mil>, Phillip Woon wrote:
> From: Phillip Woon <pw...@med.osd.mil>
> Newsgroups: borland.public.delphi.vcl.components.using
> Subject: Hourglass on form close after Disabling the form
> Date: Wed, 11 Feb 1998 11:32:42 -0500

> Hi
>    Does anyone know how to disable a form (the main form) when quitting,
> and setting the cursor to hourglass.  I'm using FileNet Workflo controls
> and in their 32 bit version, the logoff property of their control takes
> about 15 seconds to log off and so I have to show the Hourglass while
> it's logging off.
> (which works with
> Screen.Cursor = crHourglass;

 ...snip...

Phillip,

put up a modal dialog without buttons as a kind of splash screen. You
know, this "Please wait while the application takes out the trash and
mops the floor...' thing. This means that the dialog needs to do the
Logonoff1.Action := LOGOFF; statement since control will not return from a
ShowModal call until the dialog closes. You use the hoary postmessage
trick: from the modal forms OnShow event post a user message to the modal
form. In the handler for this message sent the cursor, do the logoff,
restore the cursor, set the forms ModalResult := mrOK to make it close.

Peter Below (TeamB)  100113.1...@compuserve.com)

Other Threads