In short, I want to use win32Api in Qt5.1.1
, And I have a simple example.
I want to pass the widget handle to the WinApi function int MessageBox(HWND hWnd, LPCTSTR lpText, LPCTSTR lpCaption, UINT uType).
The problem in the first parameter (HWND hWnd, ...)
.
My attempt: (Failed)
WId wind = (HWND)w.winId(); // `w` is the instance of my widget.
MessageBox(wind, "Hello world!", "Message", MB_OK);
How to obtain the widget(window) handle, to passed to MessageBox
winapi function ?