Move the check for HWND to be right after the CreateWindow() call
Move the check for HWND to be right after the CreateWindow() call

By moving the check, it ensures that the error message obtained if it
fails is correct and not the error message that SetWindowLong() gives
due to an invalid HWND.

Merge-request: 1910
Reviewed-by: Denis Dzyubenko <f3baa9d2a2ef0e289846537f083a7f7d228f87c6@nokia.com>

igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,radekp/qt,radekp/qt,radekp/qt,pruiz/wkhtmltopdf-qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,igor-sfdc/qt-wk,radekp/qt,pruiz/wkhtmltopdf-qt,igor-sfdc/qt-wk,igor-sfdc/qt-wk,radekp/qt,radekp/qt