阅读背景:

DWORD iProcessID=GetCurrentProcessId(); DWORD iThreadID=GetCurrentThreadId

来源:互联网 
// ProcessThreadID.cpp : Defines the entry point for the application.
//

#include "stdafx.h"

int APIENTRY WinMain(HINSTANCE hInstance,
                     HINSTANCE hPrevInstance,
                     LPSTR     lpCmdLine,
                     int       nCmdShow)
{
 	// TODO: Place code here.

	HANDLE hProcess=GetCurrentProcess();
	HANDLE hThread=GetCurrentThread();
	TCHAR strProcess[256];
	TCHAR strThread[256];
	wsprintf(strProcess,"%d",hProcess);
	wsprintf(strThread,"%d",hThread);

	MessageBox(NULL,strProcess,strThread,MB_OK);
//////////////////////////////////

	DWORD iProcessID=GetCurrentProcessId();
	DWORD iThreadID=GetCurrentThreadId();
	//TCHAR strProcess[256];
	//TCHAR strThread[256];
	wsprintf(strProcess,"%d",iProcessID);
	wsprintf(strThread,"%d",iThreadID);

	MessageBox(NULL,strProcess,strThread,MB_OK);
	return 0;
}


// ProcessThreadID.cpp : Defines the entry poin



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: