Fix build on Windows systems with Qt5.

WId, the return type of winId(), doesn't alias to HWND anymore in
Qt5, so we add a cast for that.