I currently have a windows API that requires a HWND hParentWnd
. My question is how can I obtain HWND of a class derived from QMainWindow
?
Asked
Active
Viewed 3,770 times
2
-
2Similar question: [Get HWND on windows with Qt5 (from WId)](http://stackoverflow.com/questions/14048565/get-hwnd-on-windows-with-qt5-from-wid) – Ilya Nov 14 '13 at 06:30
1 Answers
2
You can use QWidget::effectiveWinId() or QWidget::winId(), this holds the HWND of the widget on Windows.
MainWindow w;
w.show();
HWND hWnd = (HWND) w.winId();