If the operations that execute in the event-handler of
the button take a long time, any Windows messages sent
to the application cannot be received in the message
loop because the execution point is still in the
event-handler method.
What (I think) is necessary there is that you should
call Application.ProcessMessages() inside the
event-handler of the button. ProcessMessages() checks
the message queue of the application for messages; and
if there is any message, it handles it accordingly.
You should be aware that calling this method slows
your code a little bit, but you will not get the -=Not
responding=-.
Do not call this in tight short loops. Somehow it is
useless. Call this method in time taking loops or
after an operation that takes much time.
As an example for long loops:
for i := 1 to 1000000 do
begin
ExecuteMyOperation(param);
if i mod 100 = 0 then
Application.ProcessMessages();
end;
I wrote -=i mod 100=- as an example. You should set
number by which you do the modulus accordingly to the
time it takes ExecuteMyOperation(), so that the
application responds well to user interaction.
--- Saurabh Rai <[EMAIL PROTECTED]> wrote:
> i have some complex database and Application process
> at a button click .. after button click my
> application's status changes to "Not Responding" in
> windows operating system .. even if its running
> according to code .. i dont know how to stop showing
> my appication as not responding for end user's ..
> coz now end user complaining about this .
>
> pls
>
suggest!-------------------------------------------------------
> Summit Information Technologies Limited, Gurgaon,
> India
>
>
> [Non-text portions of this message have been
> removed]
>
>
____________________________________________________________________________________
Be a better friend, newshound, and
know-it-all with Yahoo! Mobile. Try it now.
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ