Search code examples
c++windowswindowhookdll-injection

Hooking window creation; hooks not being triggered


Essentially I'm inside a process' memory via an injected DLL and I want to stop window creation. I've tried hooking the following:

  • CreateWindowExW
  • CreateDialogParamW
  • DialogBoxParamW

Unfortunately, the creation of the window I want to destroy is not triggering any of my hooks. There are several IE controls within the aforementioned window and the CreateWindowExW calls are being hit for them; but not the actual window I want. It's a simple popup box, and does show up in Spy++/Window Hack so I'm certain it's an actual window.

Any ideas?


Solution

  • You need to try all the possible variations of the functions you are trying to hook CreateWindowExA, CreateWindowW, CreateWindowA, etc. They aren't necessarily just wrappers around the main *W one.