views:

433

answers:

1

Hey, I'm grabbing a window handle with the following code:

HWND hwnd = FindWindow(L"QWidget", NULL);

and it returns a HWND to a QWidget (I checked with Spy++, the handles match). But after this, if I try the following:

QWidget* widget = QWidget::find(hwnd);

or

QWidget* widget = QWidget::find((WId)hwnd);

widget is always 0. Does anyone know why? Am I using QWidget::find() correctly?

Thanks,

Dave

+1  A: 

solved: was compiling in debug, so QtGui4d.dll was loaded instead of QtGui4.dll

David Menard