Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT sources DOT redhat DOT com Delivered-To: mailing list cygwin AT sources DOT redhat DOT com Date: Thu, 21 Jun 2001 19:50:46 +0300 Message-Id: <200106211650.TAA22309@linux.> From: "Ehud Karni" To: "Brian Michael Genisio" Subject: Re: set priority? CC: cygwin AT cygwin DOT com In-reply-to: <200106201945.f5KJjhZ44108@pilot19.cl.msu.edu> (message from Brian Michael Genisio on Wed, 20 Jun 2001 15:45:43 -0400 (EDT)) Organization: Simon & Wiesel Insurance agency Reply-to: ehud AT unix DOT simonwiesel DOT co DOT il References: <200106201945 DOT f5KJjhZ44108 AT pilot19 DOT cl DOT msu DOT edu> X-Mailer: Emacs 20.7.1 rmail (send-msg 1.104) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-8 Content-Transfer-Encoding: 7bit On Wed, 20 Jun 2001 15:45:43 -0400 (EDT), Brian Michael Genisio 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 /* 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 , 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:ehud AT unix DOT simonwiesel DOT co DOT il http://www.simonwiesel.co.il -- Want to unsubscribe from this list? Check out: http://cygwin.com/ml/#unsubscribe-simple