title: String comparsion in win32 C++
body: <p>I want to write a simple programm that if SbieCtrl.exe process is running in my machine, My program report it in output. But my code doesn't work. I put my code in the following :</p>
  
  <p>My Class Code :</p>
  
  <pre><code>    bool processTools(string processName) {
  
      HANDLE hProcessSnap;
      PROCESSENTRY32 pe32;
      hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
  
      if (hProcessSnap == INVALID_HANDLE_VALUE) {
          procRunning = false;
      }
      else {
          pe32.dwSize = sizeof(PROCESSENTRY32);
          if (Process32First(hProcessSnap, &amp;pe32)) { 
              if (pe32.szExeFile == processName) {
                  procRunning = true;
              }
              else {
                  while (Process32Next(hProcessSnap, &amp;pe32)) {
                      compare = pe32.szExeFile;
                      if (compare == processName) {
                          procRunning = true;
                          break;
                      }
                  }
              }
              CloseHandle(hProcessSnap);
          }
      }
  
      return procRunning;
  }
  </code></pre>
  
  <p>My Object Code: </p>
  
  <pre><code>class Sandboxie : Base {
  public:
      int SandboxieProcess() {
          if (processTools("SbieCtrl.exe")) {
              return 1;
          }
          else {
              return 0;
          }
      }
  };
  </code></pre>
  
  <p>Why this code doesn't work. I has several error like comparsion in "if (pe32.szExeFile == processName)" section. </p>