TA的每日心情 | 开心 2024-02-17 18:16 |
---|
签到天数: 14 天 [LV.3]偶尔看看II
管理员
这里没有广告...
- 积分
- 10709
|
- #include "stdafx.h"
- #include <windows.h>
- DWORD WINAPI ThreadProc(LPVOID lpParam)
- {
- printf("ThreadProc\n");
- return -1;
- }
- int _tmain(int argc, _TCHAR* argv[])
- {
- DWORD dwThreadId;
- HANDLE hThread = CreateThread(
- NULL,
- 0,
- ThreadProc,
- NULL,
- 0,
- &dwThreadId);
- printf("ThreadID:%d\n", dwThreadId);
-
- // 等待线程运行结束
- if (WAIT_OBJECT_0 == WaitForSingleObject(hThread, INFINITE))
- printf("Thread end.\n");
- return 0;
- }
复制代码 |
|