Board index » delphi » adjusting applicatin priority (vs. a thread's)

adjusting applicatin priority (vs. a thread's)

Simple question: how do I adjust an application's (window's
dispatching) priority? [I understand and have used tthread.priority to
adjust thread priorities up and down in the past... and was hoping to
find an application.priority or something like that - but didn't.] I
assume that there is a windows api call to adjust the application's
priority. In searching the win32 and w32skd helps I don't find
anything. Anyone have any clues on where I should be looking, or what
the appropriate api call might be?. [if it makes any difference - I'm
using D4 c/s].
many thanks,
greg mushial
 

Re:adjusting applicatin priority (vs. a thread's)


Bj?rge S?ther
bjorge@hahaha_itte.no
"greg mushial" <gmush...@gmdr.com> skrev i melding
news:3d067aea.35866170@news.supernews.com...

Quote
> Simple question: how do I adjust an application's (window's
> dispatching) priority? [I understand and have used tthread.priority to
> adjust thread priorities up and down in the past... and was hoping to
> find an application.priority or something like that - but didn't.] I
> assume that there is a windows api call to adjust the application's
> priority. In searching the win32 and w32skd helps I don't find
> anything. Anyone have any clues on where I should be looking, or what
> the appropriate api call might be?. [if it makes any difference - I'm
> using D4 c/s].

From Win32.hlp on "SetThreadPriority":

<<All threads initially start at THREAD_PRIORITY_NORMAL. Use the
GetPriorityClass and SetPriorityClass functions to get and set the priority
class of a process. Use the GetThreadPriority function to get the priority
value of a thread.

Use the priority class of a process to differentiate between applications
that are time critical and those that have normal or below normal scheduling
requirements. Use thread priority values to differentiate the relative
priorities of the tasks of a process. For example, a thread that handles
input for a window could have a higher priority level than a thread that
performs intensive calculations for the CPU.>>

--

Re:adjusting applicatin priority (vs. a thread's)


Simple question: how do I adjust an application's (window's
dispatching) priority? [I understand and have used tthread.priority to
adjust thread priorities up and down in the past... and was hoping to
find an application.priority or something like that - but didn't.] I
assume that there is a windows api call to adjust the application's
priority. In searching the win32 and w32skd helps I don't find
anything. Anyone have any clues on where I should be looking, or what
the appropriate api call might be?. [if it makes any difference - I'm
using D4 c/s].
many thanks,
greg mushial

Re:adjusting applicatin priority (vs. a thread's)


On Wed, 12 Jun 2002 13:24:22 GMT, gmush...@gmdr.com (greg mushial)
wrote:

Bjorge - thanks for the pointer - that gives me a start...   and sorry
about the dup posting [pre-morning coffee screwup on my part]

Quote
>Simple question: how do I adjust an application's (window's
>dispatching) priority? [I understand and have used tthread.priority to
>adjust thread priorities up and down in the past... and was hoping to
>find an application.priority or something like that - but didn't.] I
>assume that there is a windows api call to adjust the application's
>priority. In searching the win32 and w32skd helps I don't find
>anything. Anyone have any clues on where I should be looking, or what
>the appropriate api call might be?. [if it makes any difference - I'm
>using D4 c/s].
>many thanks,
>greg mushial

Re:adjusting applicatin priority (vs. a thread's)


"greg mushial" <gmush...@gmdr.com> skrev i melding
news:3d074eff.2733939@news.supernews.com...

Quote
> On Wed, 12 Jun 2002 13:24:22 GMT, gmush...@gmdr.com (greg mushial)
> wrote:

> Bjorge - thanks for the pointer - that gives me a start...   and sorry
> about the dup posting [pre-morning coffee screwup on my part]

> >Simple question: how do I adjust an application's (window's
> >dispatching) priority? [I understand and have used tthread.priority to
> >adjust thread priorities up and down in the past... and was hoping to
> >find an application.priority or something like that - but didn't.] I
> >assume that there is a windows api call to adjust the application's
> >priority. In searching the win32 and w32skd helps I don't find
> >anything. Anyone have any clues on where I should be looking, or what
> >the appropriate api call might be?. [if it makes any difference - I'm
> >using D4 c/s].

I wrote this before seeing your second posting:

procedure TForm1.FormCreate(Sender: TObject);
var
  H: THandle;
begin
  H:=GetCurrentProcess;
  SetPriorityClass(H, REALTIME_PRIORITY_CLASS);
end;

...this works...

--
Bj?rge S?ther
bjorge@hahaha_itte.no

Other Threads