Can I use DirectX(9 or 11) directly in UE4?

I’m using 4.12.5 under win7 and trying to take screenshots for my desktop continuously (these screenshots are used as textures in game thread) within UE.

I’ve tried the GDI way, which is using BitBlt and GetDIBits methods, and found it lead to a bad FPS (~40).

Now I’m trying to use the DirectX way for screenshot, but blocked by a ‘failed to open d3dx9.lib’ linking error.
I’ve included ‘D3D9.h’ while using DirectX stuff and added dependency for ‘DX9’ module in my Build.cs.

I already know a way for accessing DirectX device with adding some code into Unreal Engine:

but I’m not willing to change or add code into Unreal Engine.

Am I missing something necessary for taking DESKTOP’s screenshot while running a PIE or a standalone window mode game?
Or is it even possible for me to use DirectX directly in UE without touching source code of Unreal Engine?

Can anyone help me plz?

Bump again.

Please inform us if you have found the solution.
Have went through GDI+ for screenshots and I am switching to the d3d9.h now however… I believe I have faced same issues as you.