0
点赞
收藏
分享

微信扫一扫

DWORD iProcessID=GetCurrentProcessId(); DWORD iThreadID=GetCurrentThreadId

一只1994 2023-06-16 阅读 87


// 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;
}



举报

相关推荐

0 条评论