Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Setting the windows 2000 process priority
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00601173
Message ID:
00602029
Views:
28
This message has been marked as the solution to the initial question of the thread.
>>>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.
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