title: c++: How to catch mouse clicks wherever they happen
body: <p>I am stuck with an application I am writing where I need to monitor for mouse clicks.</p>
  
  <p>The clicks may happen anywhere on the screen and not inside the app window, and for each click I must pass a message (perform an action or something).</p>
  
  <p>I looked around and read some suggestions like using</p>
  
  <pre><code>LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
  </code></pre>
  
  <p>but I was unsuccessful.</p>
  
  <p>Does anyone have an idea on how to implement what I need?</p>