HANDLE hProcess = NULL;
hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, GetCurrentProcessId());
if(hProcess != NULL)
{
if(SetPriorityClass(hProcess, REALTIME_PRIORITY_CLASS))
{
MessageBox(NULL, TEXT("设置进程优先级为实时成功!"), TEXT("警告"), MB_OK);
} else {
MessageBox(NULL, TEXT("设置进程优先级为实时失败!"), TEXT("警告"), MB_OK);
}
}
SetThreadPriority(This->EventThread, THREAD_PRIORITY_HIGHEST); //设置线程优先级