From: Rhys O. <ska...@ho...> - 2005-01-06 17:54:33
Hi, I want to know how to set the default priority of a C++ program to
realtime (in windows).
If you know how to do this, or want me to be more specific, please reply.
Cheers
~ Roo
From: David M. <dml...@co...> - 2005-01-07 02:00:00
I assume you mean how to have the program set it's own priority to the
real time class.
The following is a snippet from some code I wrote.
# define WIN32_LEAN_AND_MEAN 1
# include <windows.h>*
...
*
if(SetPriorityClass( GetCurrentProcess(), IDLE_PRIORITY_CLASS) == 0)
{
cout << "\nError setting priority for process id #" <<
GetCurrentProcessId() << endl;
cout << "Error # = " << GetLastError() << endl;
}
Look for the documentation for the constant for the real-time class. If
you want the rest of the stuff in windows.h then you can remove the lean
and mean define.
hys Owen wrote:
> Hi, I want to know how to set the default priority of a C++ program to
> realtime (in windows).
> If you know how to do this, or want me to be more specific, please reply.
>
> Cheers
> ~ Roo
>
>
>
>
> -------------------------------------------------------
> The SF.Net email is sponsored by: Beat the post-holiday blues
> Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
> It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>