Mark
Wed Feb 04 16:47:54 CST 2004
Actually I eventually did find these two API functions:
DECLARE INTEGER SetPriorityClass IN Win32api INTEGER,INTEGER
DECLARE INTEGER SetThreadPriority IN Win32api INTEGER,INTEGER
I can't seem to get the EXE to show up as "BelowNormal" in the task manager.
I can get it to show up as "Low" by the following call:
#DEFINE NORMAL_PRIORITY_CLASS 32
#DEFINE IDLE_PRIORITY_CLASS 64
#DEFINE HIGH_PRIORITY_CLASS 128
#DEFINE REALTIME_PRIORITY_CLASS 256
DECLARE INTEGER SetPriorityClass IN Win32api INTEGER,INTEGER
Declare Long GetCurrentProcess In kernel32
SetPriorityClass(getcurrentprocess(), IDLE_PRIORITY_CLASS)
I see that there is a constant defined for a thread priority below normal
(THREAD_PRIORITY_BELOW_NORMAL -1), but using this does not change the
process to "BelowNormal".
I am missing something.....what?
--------
No matter what
"Lee Mitchell" <Leemi@online.microsoft.com> wrote in message
news:P%2337b226DHA.1992@cpmsftngxa07.phx.gbl...
> Hi Mark:
>
> I am not sure if this will give you what you need, but I think it is
start.
> Take a look at the "Enumerate Processes in Windows" utility on
> universalthread.com. Go to www.universalthread.com, click on the Download
> icon, and choose Visual FoxPro as the product. In the ID text box of the
> query page, search for "9651."
>
> I hope this helps.
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
> Sincerely,
> Microsoft FoxPro Technical Support
> Lee Mitchell
>
> *-- VFP8 HAS ARRIVED!! --*
> Read about all the new features of VFP8 here:
>
http://www.universalthread.com/VisualFoxPro/News/VFP8Release.asp
> Purchase VFP8 here:
>
http://shop.microsoft.com/Referral/Productinfo.asp?siteID=11518
>
> Keep an eye on the product lifecycle for Visual FoxPro here:
>
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retires Sept. 30th, 2003
>
>
> >I have a VFP 8 EXE and I want the EXE to run with a lower process/thread
> >priority automatically.
>
> >How do I change the EXE process priority from within the running EXE?
>
> >M.
>