<p>How can I detect mouse clicks regardless of the window the mouse is in?</p>

<p>Perferabliy in python, but if someone can explain it in any langauge I might be able to figure it out.</p>

<p>I found this on microsoft's site:
<a href="http://msdn.microsoft.com/en-us/library/ms645533(VS.85).aspx" rel="noreferrer">http://msdn.microsoft.com/en-us/library/ms645533(VS.85).aspx</a></p>

<p>But I don't see how I can detect or pick up the notifications listed.</p>

<p>Tried using pygame's pygame.mouse.get_pos() function as follows:</p>

<pre><code>import pygame
pygame.init()
while True:
    print pygame.mouse.get_pos()
</code></pre>

<p>This just returns 0,0.
I'm not familiar with pygame, is something missing?</p>

<p>In anycase I'd prefer a method without the need to install a 3rd party module.
(other than pywin32 <a href="http://sourceforge.net/projects/pywin32/" rel="noreferrer">http://sourceforge.net/projects/pywin32/</a> )</p>

The windows way of doing it is to handle the
```
WM_LBUTTONDBLCLK
```
message.
For this to be sent, your window class needs to be created with the
```
CS_DBLCLKS
```
class style.
I'm afraid I don't know how to apply this in Python, but hopefully it might give you some hints.