Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Process priority
Message
From
27/05/2002 10:58:36
 
 
To
27/05/2002 10:08:46
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00661648
Message ID:
00661689
Views:
30
This message has been marked as the solution to the initial question of the thread.
>>>Can the priority of a process or program be controlled in Windows 95 or Windows 98? Or is Windows NT required to do this sort of tricks?
>>>
>>>Basically, I need to do some background process (maintenance, backup, etc.) regularly, and want it to interfere as little as possible with programs in the foreground. The time taken for the background process is, of course, secondary: if it takes 30 minutes instead of 15, and I use the computer normally (right now, the background process makes the computer terribly slow), that's fine.
>>
>>Yes, the process priority can be adjusted, either at the time that the process is spawned, or subsequently given a valid Process handle with adequate privileges using SetPriorityClass(), as documented in the Win32 API section here on UT as #12682. Finer control can be achieved given a thread handle using SetThreadPriority(), which allows you to adjust the relative priority of a thread within a process group rather than shifting it to a different process group, as documented in #12689.
>
>First of all, thanks a lot.

Yep - use my API_APPRUN class rather than run - it returns both a process handle and a thread handle that can be used to adjust the priority. Jusr use the LaunchApp() method and then grab the desired handle from the Process class instance and do your thing...

>
>Now, the text for the API function mentions only an existing thread, but not spawning a new thread. Basically, I call some external programs, e.g., for data compression. Currently I use RUN, without /N, since I have to do several steps in a certain order - I assume I should use another approach here?
>
>Hilmar.
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform