title: Which thread is used in the same function of multithread
body: <p>In mfc code,</p>
  
  <p>Declare as follow</p>
  
  <pre><code>CWinThread* _pThread[5];
  DWORD _ThreadArg[5] = { HIGHEST_THREAD, // 0x00
                      ABOVE_AVE_THREAD, // 0x3F
                      NORMAL_THREAD, // 0x7F
                      BELOW_AVE_THREAD, // 0xBF
                      LOWEST_THREAD // 0xFF
                      }; 
  
  int i;
  for (i= 0; i&lt; 5; i++)
  {
      _pThread[i] = AfxBeginThread(ThreadFunc,
                                  &amp;_ThreadArg[i],
                                  THREAD_PRIORITY_NORMAL,
                                  0,
                                  //CREATE_SUSPENDED,
                                  NULL,
                                  NULL);
      //_pThread[i]-&gt;ResumeThread();
  }
  // setup relative priority of threads
  _pThread[0]-&gt;SetThreadPriority(THREAD_PRIORITY_HIGHEST);
  _pThread[1]-&gt;SetThreadPriority(THREAD_PRIORITY_ABOVE_NORMAL);
  _pThread[2]-&gt;SetThreadPriority(THREAD_PRIORITY_NORMAL);
  _pThread[3]-&gt;SetThreadPriority(THREAD_PRIORITY_BELOW_NORMAL);
  _pThread[4]-&gt;SetThreadPriority(THREAD_PRIORITY_LOWEST);
  </code></pre>
  
  <p>use same thread function </p>
  
  <pre><code>UINT CThreadPoolDlg::ThreadFuncTh1(LPVOID ThreadArg)
  {
      DWORD dwArg = *(DWORD*)ThreadArg;
      //txtTh[0].SetWindowTextW(_T("23"));
      AfxGetMainWnd()-&gt;GetDlgItem(IDC_THD1)-&gt;SetWindowText(_T("1"));
      return 0;
  }
  </code></pre>
  
  <p>How do I check which thread is in use in same function?</p>