>>>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.