HANDLE WINAPI GetCurrentProcess(void);
#include "stdafx.h"
#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));
return 0;
}
My PID is 6540
my Handle is -1
Get my PID through My real handle: 6540
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |