Subject: Re: set priority?
From: "Ehud Karni" <[email-masked]>
To: "Brian Michael Genisio" <[email-masked]>
Cc: [email-masked]
Date: Thu, 21 Jun 2001 19:50:46 +0300

On Wed, 20 Jun 2001 15:45:43 -0400 (EDT), Brian Michael Genisio <[email-masked]> wrote:
> 
> Is there a way through a cygwin tool to set the priority from normal to high or
> real in Windows?  I can do it through a shareware program, and it increases the
> efficiency of my app, but I want to do it in a script.  Any Ideas?

Yes. Here is a sample code that does it (tested).
#include <windows.h>                   /* for some specific Windoz calls */
   {
   HANDLE WinId ;
       WinId = GetCurrentProcess ( ) ;             /* get my Windows HANDLE */
       SetPriorityClass ( WinId , REALTIME_PRIORITY_CLASS ) ;  /* set priority to REAL TIME CLASS */
   }
The 4 defined priority classes are: NORMAL_PRIORITY_CLASS,
IDLE_PRIORITY_CLASS, HIGH_PRIORITY_CLASS, REALTIME_PRIORITY_CLASS.

Note. The include is from an old program, it might have changed to
<w32api/windows.h>, I did not compile it lately, and I can't do it here.

Ehud.

-- 
 Ehud Karni     Mivtach - Simon  Insurance   /"\
 Tel: +972-3-6212-757 Fax: +972-3-6292-544   \ /  ASCII Ribbon Campaign
 (USA) Fax and  voice  mail: 1-815-5509341    X   Against  HTML  Mail
     Better     Safe     Than     Sorry      / \
     mailto:[email-masked]    http://www.simonwiesel.co.il

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple