The ReleaseMouseCapture method disables mouse capture for an object that has captured the mouse by using the CaptureMouse method. When an object has captured the mouse, it receives mouse input whether or not the mouse pointer is within its bounds.
Calling ReleaseMouseCapture on an object that did not have mouse capture has no effect.