[C++] 纯文本查看 复制代码
#include "stdafx.h"
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
printf ("My PID is %d\n", GetCurrentProcessId());
printf ("my Handle is %d\n", GetCurrentProcess());
HANDLE hMyselfHandle = OpenProcess (PROCESS_ALL_ACCESS, TRUE, GetCurrentProcessId());
printf ("Get my PID through My real handle: %d\n", GetProcessId(hMyselfHandle));
printf ("Priority: 0x%.8x\n", GetPriorityClass(hMyselfHandle));
SetPriorityClass(hMyselfHandle, HIGH_PRIORITY_CLASS);
printf ("Priority: 0x%.8x\n", GetPriorityClass(hMyselfHandle));
return 0;
}