🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
4 messages
4 total messages Started by mk Mon, 06 Aug 2007 15:04
priority
#1460
Author: mk
Date: Mon, 06 Aug 2007 15:04
2 lines
860 bytes
How to set an application's priority level?
Re: priority
#1461
Author: Dennis Jones
Date: Mon, 06 Aug 2007 16:08
11 lines
1144 bytes
"mk" <mkreuter@kmccontrols.com> wrote in message 
news:46b73889$1@newsgroups.borland.com...
>
> How to set an application's priority level?

See:

SetPriorityClass and SetThreadPriority.

- Dennis 
Re: priority
#1462
Author: mk
Date: Mon, 06 Aug 2007 16:42
26 lines
1433 bytes
"Dennis Jones" <nospam@nospam.com> wrote:
>
>"mk" <mkreuter@kmccontrols.com> wrote in message 
>news:46b73889$1@newsgroups.borland.com...
>>
>> How to set an application's priority level?
>
>See:
>
>SetPriorityClass and SetThreadPriority.
>
>- Dennis 
>
>

This code does not error out but Task Manager does not show the priority as high ....

if ( !SetThreadPriority( GetCurrentThread(),    THREAD_PRIORITY_HIGHEST ))
{
   result = GetLastError();
   sprintf( buffer, "Error [%d]", result );
   Application->MessageBox( buffer, APP_TITLE, MB_OK );
}

if I use Application->Handle, it errors out and reports a bad handle ...
Re: priority
#1463
Author: Dennis Jones
Date: Mon, 06 Aug 2007 17:14
39 lines
1945 bytes
"mk" <mkreuter@kmccontrols.com> wrote in message 
news:46b74f74$1@newsgroups.borland.com...
>
> "Dennis Jones" <nospam@nospam.com> wrote:
>>
>>"mk" <mkreuter@kmccontrols.com> wrote in message
>>news:46b73889$1@newsgroups.borland.com...
>>>
>>> How to set an application's priority level?
>>
>>See:
>>
>>SetPriorityClass and SetThreadPriority.
>>
>>- Dennis
>>
>>
>
> This code does not error out but Task Manager does not show the priority 
> as high ....
>
> if ( !SetThreadPriority( GetCurrentThread(),    THREAD_PRIORITY_HIGHEST ))
> {
>   result = GetLastError();
>   sprintf( buffer, "Error [%d]", result );
>   Application->MessageBox( buffer, APP_TITLE, MB_OK );
> }

That's because the Task Manager shows the application's priority class, not 
thread priority.


> if I use Application->Handle, it errors out and reports a bad handle ...

That's because SetThreadPriority taks a thread handle, not an application 
handle.  SetPriorityClass is the one that takes an application handle.

- Dennis 
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads