🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
2 messages
2 total messages Started by Benoit Mon, 12 May 2003 08:58
Set priority of a process
#16508
Author: Benoit
Date: Mon, 12 May 2003 08:58
15 lines
1483 bytes
Hello !

I must upgrade my application (process) in a realtime priority.
I work with Win2000 Server (with administrator's rights) and use Borland C++
6, and I try to use the fonction SetClassPriority() but it always return an
error (and GetClassPriority too). And the error returned by GetLastError()
is unexpected, something like : "Window do not have any scrollbar" !!

Is there another way to set a high priority to my process and if possible,
dynamically, to set it "realtime" just for a moment and to restablish the
normal priority after ?

Thanks for your help
Bye
ben
Re: Set priority of a process
#16515
Author: Vladimir Afanasyev
Date: Mon, 12 May 2003 10:19
24 lines
1453 bytes
Hi,
May be your code incorrect.
What way do you use?
As a rule I use next:

bool res=SetPriorityClass(
    GetCurrentProcess(),	// handle to the process  
    REALTIME_PRIORITY_CLASS	// priority class value 
   );

if(res ....)


bool res=SetPriorityClass(
    GetCurrentProcess(),	// handle to the process  
    NORMAL_PRIORITY_CLASS	// priority class value 
   );


for current process. Or you want to do it for another 
process?

Vladimir.
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