wxWindow* win = wxWindow::GetCapture();
if (win && win->HasCapture())
win->ReleaseMouse();
But now the forum says "Warning: this topic has not been posted in for at least 120 days. Unless you're sure you want to reply, please consider starting a new topic." So, here it is.This is a case where you're sure you want to reply. You should have used the old topic.