>>>Does anyone know how to set the priority of a process in windows 2000 programatically from VFP?
>>
>>Hi Eylon,
>>
>>Take a look at Message #
527632 for some ideas.
>
>Hello Sergey - I did - thanks. Still - this is for a VFP 6 app and I need a way to get the windows handle from the form.
You really need the Thread ID, not the hWnd of a form; the easiest way to do this within the current process is GetCurrentThreadID(), or if you are launching it from a VFP app, you can use my API_APPRUN class, which returns the process and thread IDs and handles for child processes when launched, and you can modify the call to CreateProcess() in API_APPRUN's LaunchApp method to permit you to set a starting priority when launching the application.
Once you have a thread handle, you simply call SetThreadPriority() or SetThreadPriorityBoost() as appropriate.
You can also use the RUN command in VFP to launch an app using the START verb prefix, which accepts a command line switch to set the process priority at runtime. See the OnLine Help for you version of Windows to get the exact notation for the START verb under your version of Windows.