Using Win32 functions in Visual FoxPro Image Gallery
Process and Thread
..msdn
AssignProcessToJobObject
CommandLineToArgvW
CreateJobObject
CreateProcess
CreateProcessAsUser
CreateProcessWithLogonW
ExitProcess
FreeEnvironmentStrings
GetCommandLine
GetCurrentProcess
GetCurrentProcessId
GetCurrentThread
GetCurrentThreadId
GetEnvironmentStrings
GetEnvironmentVariable
GetPriorityClass
GetProcessIoCounters
GetProcessTimes
GetProcessVersion
GetStartupInfo
GetThreadPriority
IsWow64Process
OpenProcess
RegisterServiceProcess
SetEnvironmentVariable
SetPriorityClass
SetThreadPriority
Sleep
TerminateJobObject
TerminateProcess
WinExec
Code examples:
Reading and setting the priority class values for the current process and thread
SetPriorityClass
..msdn    Add comment     W32 Constants      Translate this page
Sets the priority class for the specified process. This value together with the priority value of each thread of the process determines each thread"s base priority level.
Code examples:
Reading and setting the priority class values for the current process and thread
Declaration:
BOOL SetPriorityClass(
  HANDLE hProcess,        // handle to process
  DWORD dwPriorityClass   // priority class
);
FoxPro declaration:
DECLARE INTEGER SetPriorityClass IN kernel32;
    INTEGER hProcess,;
    INTEGER dwPriorityClass
Parameters:
hProcess
[in] Handle to the process.

dwPriorityClass
[in] Specifies the priority class for the process. This parameter can be one of the predefined values.
Return value:
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.
Word Index links for the SetPriorityClass :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-12-17 23:23:11
Modified: 2001-12-17 23:27:08
Visited in last 7 days: 21
User Contributed Notes:
sondovsa@comcast.net | 2008-02-05 16:54:51
When I run your example named below using VFP 9 SP2 the SetPriorityClass function return a value of zero.  GetLastError then returns a value of 5 (Access denied).
The priority of my exe remains normal. I was expecting it to be High.

Reading and setting the priority class values for the current process and thread 

Any help would be appreciated!
A.M. | 2008-02-07 21:55:43
That means either the user account does not have rights to change the priority or the handle to the process does not have the PROCESS_SET_INFORMATION access right.

Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (23.20.64.16)
33 sec.Function: 'RegisterHotKey'
47 sec.Function: 'SetDlgItemText'
1.05 min.Function: 'SetupGetInfInformation'
1.32 min.Function: 'SearchPath'
1.55 min.Function: 'WinHttpReceiveResponse'
1.8 min.Function: 'recv'
2 min.Function: 'UnregisterHotKey'
2.25 min.Function: 'waveInGetPosition'
Google
Advertise here!