directx-present-hook icon indicating copy to clipboard operation
directx-present-hook copied to clipboard

Hooking IDXGISwapChain::Present in another process

Open Linside opened this issue 3 years ago • 1 comments

Hi, The example works well, it is very useful for me! Now I'm considering to capture window of other processes, and made some changes to test:

 // Set the hook object to capture some frames.
 hr = HookT::Get()->CaptureFrames(blackBoxDXWindow.GetHandle(), outputFolder, 10);

to

  // Set the hook object to capture some frames, but for another window.
  HWND hwnd = FindWindowW(NULL, L"Another Window");
  hr = HookT::Get()->CaptureFrames(hwnd, outputFolder, 10);

I'm using dx11 and I found the D3D11PresentHook::SwapChainPresent function still only catching the swapchain of the blackbox window created by its own. I have noticed that the address of presentPointer_ in D3D11PresentHook::Hook is always the same, so I supposed the polyhook will work like some global hook of SetWindowsHook, but it's seems not. And now I think the problem is cross-process, do you have any idea of this issue or I missed up something?

Linside avatar Jun 02 '22 09:06 Linside

I have the same question! Can't hooking another process!

timercrack avatar May 05 '23 13:05 timercrack