title: How does GetModuleHandle work in Visual c++
body: <p>I am new to c++ and this code always returns NULL even though i know the file exists:</p>
  
  <pre><code>HMODULE hModule = GetModuleHandle(TEXT("C:\\Users\\Steve\\Desktop\\stub.exe"));
  </code></pre>
  
  <p>Interestingly, if i copy stub.exe to C:\Windows\system32, it finds the module with this code:</p>
  
  <pre><code>HMODULE hModule = GetModuleHandle(TEXT("stub.exe"));
  </code></pre>
  
  <p>Am i missing something incredibly basic?</p>