🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #14036

Re: TThread can't be Resumed when the application is not Active (focused)?

#14036
From: Phuoc Can HUA
Date: Sat, 06 Sep 2003 13:47
61 lines
3075 bytes
After I sent out my repeat posting somehow my news reader start loading the 
messages from this morning (with your reply).

I believe that it should not have anything to do with focus as well. But 
it's working fine if the focus is on the main form all the time 
(Win98/Win2K).

Ok, some more details what I've observed:
1) The thread is running without any delay (playing music) even when I was 
using other application in foreground. It only hangs when the constructor 
is called and the main form is not focused.
For my test, shortly before the next object is instantiated I click on an 
icon on the desk top. The program will lose focus and hang.

2) Currently, I've got it partially fixed. My program has 2 forms. Now I've 
moved the Resume and while loop to the main form. The problem in (1) 
doesn't occur any more. But now if I focus on the 2nd form (instead of an 
icon on desktop) it fails again.

Anyone has any idea? It looks like the Resume has something to do with 
focus. But the strange thing is in (2) when I click on an icon although the 
main form lost focus as well it didn't hang.

Phuoc Can HUA

On Fri, 5 Sep 2003 18:47:20 -0700, Remy Lebeau (TeamB) <gambit47@yahoo.com> 
wrote:

>
> "Phuoc Can HUA" <home}-a-t-{huaonline-dot}com> wrote in message
> news:opru1z6kriypkypy@newsgroups.borland.com...
>
>> Is it true that Execute is not resumed while the application is not
> active?
>
> No, it is not true. Executing a thread has nothing to do with focus at 
> all.
>
> However, what is a possibility is if your CPU is somehow being pegged 
> from
> another process, thus not allowing the CPU to task switch back to your
> thread to let it execute properly.  Have you tried checking your 
> TaskManager
> yet?
>
>
> Gambit
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.515 / Virus Database: 313 - Release Date: 9/1/03
>
>
>



-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Technical Details
Message-ID: <opru2y8rz4ypkypy@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <opru1z6kriypkypy@newsgroups.borland.com> <3f593c8b$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,453649a6bac9d07b
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-09-06 06:51:16 PST
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: TThread can't be Resumed when the application is not Active (focused)?
References: <opru1z6kriypkypy@newsgroups.borland.com> <3f593c8b$1@newsgroups.borland.com>
Message-ID: <opru2y8rz4ypkypy@newsgroups.borland.com>
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: Phuoc Can HUA <home}-a-t-{huaonline-dot}com>
MIME-Version: 1.0
Date: Sat, 06 Sep 2003 23:47:05 +1000
User-Agent: Opera7.10/Win32 M2 build 2840
NNTP-Posting-Host: 203.213.53.98
X-Trace: newsgroups.borland.com 1062855999 203.213.53.98 (6 Sep 2003 06:46:39 -0700)
Lines: 61
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail