![]() |
|
|
| Subject:
Changing the Process Priority in C++ (Windows)
Category: Computers > Programming Asked by: avalanche-ga List Price: $14.50 |
Posted:
22 Dec 2003 20:03 PST
Expires: 23 Dec 2003 01:35 PST Question ID: 289638 |
I've written an unmanaged C++ console application using MS Visual Studio .NET 2003. The program is a server that is called by Apache that does some lengthy processing. I'm not very familiar with the Windows API so I'd appreciate it if somebody can just give me the ***raw C++ code to change the application's own process priority down one notch below 'normal'***. Thanks. |
|
| There is no answer at this time. |
|
| Subject:
Re: Changing the Process Priority in C++ (Windows)
From: wonlay-ga on 22 Dec 2003 23:42 PST |
#include <windows.h>
//include Kernel32.lib in link parameters
//......
if (
SetPriorityClass (
GetCurrentProcess(),
BELOW_NORMAL_PRIORITY_CLASS
);
//......
/*
REALTIME_PRIORITY_CLASS------highest
HIGH_PRIORITY_CLASS
ABOVE_NORMAL_PRIORITY_CLASS
NORMAL_PRIORITY_CLASS
BELOW_NORMAL_PRIORITY_CLASS
IDLE_PRIORITY_CLASS------lowest
*/ |
| Subject:
Re: Changing the Process Priority in C++ (Windows)
From: wonlay-ga on 23 Dec 2003 00:06 PST |
//Sorry, like that ~
~_#include <windows.h>
//include Kernel32.lib in link parameters
//......
SetPriorityClass (
GetCurrentProcess(),
BELOW_NORMAL_PRIORITY_CLASS
);
//...... |
| Subject:
Re: Changing the Process Priority in C++ (Windows)
From: avalanche-ga on 23 Dec 2003 01:31 PST |
Wow, simple enough. :) It worked. Thanks, wonlay. |
If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you. |
| Search Google Answers for |
| Google Home - Answers FAQ - Terms of Service - Privacy Policy |