qt - Finding a 3rd party QWidget with injected code & QWidget::find(hwnd) -


I have a QT DLL, I access the library using third-party windows:

  if DLL (path, zero, zero, zero, TRUE, CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED, NULL, NULL, & PI, "C: \ program files \\\" with Microsoft \ Bin \\ detoured.dll "," C: \\ user \\ Dave \\ document \\ Visual Studio 2008 \\ projects \\ xor \ debug \ xor dail \ ", tap))  

and then I have set the system-wide hook to block window creation:

  HHOOK h_hook = :: SetWindowsHookEx (WH_CBT, (HOOKPROC) CBTProc, Status :: GetInstance) - & gt; Mill Ecore Instance (), 0);  

Where XOR is the name of my program, and the status :: getInstance () is a singleton where I have globals.

In my CBT callback, I want to stop all the windows that are QWidgets:

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

Which works well, since I get the related HWND (I check with Spy ++), I want to get an indicator on QWidget, so I can use its functions:

  QWidget * q = QWidget :: Search (HWD);  

But here's the problem, the returned indicator is always 0. Do I not inject my code properly in the process? Or am I not using QWidget :: find () as I want?

Thanks,

Dave

EDIT: If I set the hook to QWidget :: find () the export function of my DLL (hence I Can set breakpoints), QWidgetPrivate :: mapper is NULL.

Answer:

Stupid mistake, I was compiled in debug, so it's QtGui4d .dll and QtCore4d.dll were not loaded, where not QtCore4.dll and QtGui. DLL


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -