_beginthreadex returns a handle to a thread:
m_hStreamStatsThread = (HANDLE) _beginthreadex( NULL, 0, StreamStatsThread, this, 0, NULL );
This handle may be used if you need to refer to the thread in calls like TerminateThread(..) for example.
According to the MSDN page on _beginthreadex, _beginthreadex won't always return a valid handle - e.g. it may also return -1L on error etc.
When a thread has completed normally, do I have to call CloseHandle on the thread handle, or can I just set its value to NULL / INVALID_HANDLE_VALUE?