#include #include DWORD WINAPI ThreadFunc( LPVOID lpParam ) { printf( "Parameter = %d.", *(DWORD*)lpParam ); return 0; } VOID main( VOID ) { DWORD dwThreadId, dwThrdParam = 1; HANDLE hThread; hThread = CreateThread( NULL, // default security attributes 0, // use default stack size ThreadFunc, // thread function &dwThrdParam, // argument to thread function 0, // use default creation flags &dwThreadId); // returns the thread identifier // Check the return value for success. if (hThread == NULL) { printf( "CreateThread failed (%d)\n", GetLastError() ); } else { _getch(); CloseHandle( hThread ); } }