[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 699
  • Last Modified:

delphi application's priority

hi

what is the delphi way to change an applications own priority to below_normal.

thx
0
zattz
Asked:
zattz
  • 2
3 Solutions
 
MerijnBSr. Software EngineerCommented:
use the SetPriorityClass api call:


        uses
 ShellApi;

...

SetPriorityClass(GetCurrentProcess, BELOW_NORMAL_PRIORITY_CLASS);

please note that BELOW_NORMAL_PRIORITY_CLASS is not supported on 95/98/NT/ME. If you target one of these platforms, you can better use IDLE_PRIORITY_CLASS

for more info see: http://msdn2.microsoft.com/en-us/library/ms686219.aspx
0
 
ZhaawZSoftware DeveloperCommented:
MerijnB, "uses ShellApi"? I think, it's "windows", not "shellapi" (it's in kernel32.dll, after all) ;)
0
 
diniludCommented:
const
   ABOVE_NORMAL_PRIORITY_CLASS=$00008000;
   BELOW_NORMAL_PRIORITY_CLASS=$00004000;
0
 
MerijnBSr. Software EngineerCommented:
> MerijnB, "uses ShellApi"? I think, it's "windows", not "shellapi" (it's in kernel32.dll, after all) ;)

oops you're right, my bad. A copy/paste bug :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now