0

So I am injecting a dll (imgui menu with a hook for d3dx9 apps) into a game and I was wondering how I could prevent the different objects inside the app being clicked through the imgui menu. Eg stop mouse input from being delivered to the underlying D3DX9 app (csgo) while the imgui menu is open.

I have tried something along the lines of:

void Hook::HookInput()
{
    SetWindowLongPtr(window, GWLP_WNDPROC, (LONG_PTR)WndProc);
    SetForegroundWindow(window);
    SetFocus(window);
}

which is called when the ImGui menu is displayed eg.

if (show_menu)
{
    Hook::HookInput();
    [...]
}

Obviously the above does not work and I end up back at square one. I obviously do not control the underlying app (csgo) as I can only hook via dll injection, otherwise I would've just disabled mouse event capturing while the menu is open in the D3DX9 app. Is there a way I could unhook the mouse from the game while the menu is open?

aberst
  • 47
  • 5
  • 1
    ``D3DX9`` is a utility library, so that's really confusing. You mean "Direct3D 9" application, right? The question is really down to if the game is using DirectInput, Win32 Messages, or a combination of both to read the mouse. – Chuck Walbourn May 03 '23 at 20:53

0 Answers0