title: Return PID By Name
body: <p>I am trying to return process ID, and I have this code. What I am doing wrong?</p>
  
  <p>Code is:</p>
  
  <pre><code>DWORD GetProcId(char* ProcName)//Get ProcessId By Name
  {
      PROCESSENTRY32   pe32;
      HANDLE         hSnapshot = NULL;
      pe32.dwSize = sizeof( PROCESSENTRY32 );
      hSnapshot = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );
  
      if( Process32First( hSnapshot, &amp;pe32 ) )
      {
          do{
              if( strcmp( pe32.szExeFile, ProcName ) == 0 )
              {
                  return pe32.th32ProcessID;
              }
          }while( Process32Next( hSnapshot, &amp;pe32 ) );
      }
  
      if( hSnapshot != INVALID_HANDLE_VALUE )
          CloseHandle( hSnapshot );
      return 0;
  
  }
  </code></pre>
  
  <p>And the error is <code>'strcmp' : cannot convert parameter 1 from 'WCHAR [260]' to 'const char *'</code></p>
  
  <p>How I can fix it, I tried few different conversions but couldn't do it.</p>