You can use the following approach to get a Window‘s Handle in Qt. This can be useful in case you need to call a Windows API (Win32 API) function that is not implemented in Qt or for any other purposes.
HWND(winId()) can be used to correctly get the handle of a window. For example you can have the following:
MessageBox(HWND(winId()), TEXT(“test”), TEXT(“test”), 0);
MessageBox function above is just an example (and a very simple one) to explain how you can pass a handle to a Windows API function.