Programming - cpueblo.com

CreateThread


글쓴이 : 유광희 날짜 : 2011-01-21 (금) 16:25 조회 : 21353
HANDLE WINAPI CreateThread(
  __in_opt   LPSECURITY_ATTRIBUTES lpThreadAttributes,
  __in       SIZE_T dwStackSize,
  __in       LPTHREAD_START_ROUTINE lpStartAddress,
  __in_opt   LPVOID lpParameter,
  __in       DWORD dwCreationFlags,
  __out_opt  LPDWORD lpThreadId
);

static DWORD __stdcall TestThread(LPVOID lpParameter)
{
	while(1)
	{
	...
	}
	return 0;
}

void func()
{
	DWORD dwThreadID;
	hTestThread = ::CreateThread(NULL, 0, TestThread, NULL, 0, &dwThreadID);
	...
	WaitForSingleObject(hTestThread, INFINITE);
}

MSDN

http://msdn.microsoft.com/en-us/library/ms682453(v=vs.85).aspx