Article View: borland.public.cppbuilder.nativeapi
Article #1592Re: ProcessMessages / HandleMessage ???
From: Thorsten Kettner
Date: Fri, 20 Jul 2007 11:55
Date: Fri, 20 Jul 2007 11:55
34 lines
1802 bytes
1802 bytes
"Remy Lebeau \(TeamB\)" wrote:
>
>"Thorsten Kettner" wrote:
>> I must tell it to give time to the other apps, too, right?
>
>Something as simple as a call to Sleep() with a timeout
>between 0-10 ms will usually do the trick.
Gosh, how easy! I just didn't take Sleep into account at all! I
always though ProcessMessages had something to do with giving
time to other apps, too, and simply didn't see that this is for
my own app's processing only.
To be able to react on close I still use ProcessMessages and
have added Sleep now. Works perfectly!
for(int i = 0; i < end; ++i)
{
...
if(i % 100 == 0)
{
Application->ProcessMessages();
if(Application->Terminated)
{
break;
}
Sleep(1);
}
}
Thank you Remy.
Thorsten.
Technical Details
Message-ID:
<46a0a2ae$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<469f87af$1@newsgroups.borland.com> <469f99e7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,130d1808941e9622 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Sender: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Reply-To: "Thorsten Kettner" <QUESTIONBYthorsten.kettner@otto.de> Subject: Re: ProcessMessages / HandleMessage ??? Newsgroups: borland.public.cppbuilder.nativeapi X-User-Info: 80.85.196.91 References: <469f87af$1@newsgroups.borland.com> <469f99e7$1@newsgroups.borland.com> NNTP-Posting-Host: 207.105.83.66 Message-ID: <46a0a2ae$1@newsgroups.borland.com> Date: 20 Jul 2007 04:55:26 -0700 X-Trace: newsgroups.borland.com 1184932526 207.105.83.66 (20 Jul 2007 04:55:26 -0700) Lines: 34 Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news.glorb.com!newsgate.cistron.nl!xs4all!feeder.news-service.com!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail