views:

223

answers:

1

I'm trying to resize a d3d window from an external application, from my application. I can resize the window, but the d3d engine still thinks its 1024x768 or w\e res your running at. I was thinking a DLL inject, but how would i go about resizing the window.

I did some research and i'm pretty sure i need to change the BackBufferWidth and BackBufferHeight.

Any ideas? Are there any good DLL librarys i can use with my C# application to do easy d3d functions like writing to the screen or changing the resolution or changing the z buffer of structs etc?

A: 

Resizing a direct3d backbuffer/window from an external application is a NON-TRIVIAL NON-SAFE application.

"Teorically" you should :

1) Stop the application (otherwise you may go into unexpected situations like crash or conflicts, or other calamities)
2-DX9) Pick the device used to create the device.
3-DX9) Call reset on the device resizing the backbuffer
4-DX9) Resize the window of the application.
5-DX9) Restart the application

2-DX10) Pick the DXGI Swapchain of the app.
3-DX10) Resize the swapchain.
4-DX10) Restart the application.

But remember that all this would be anyway useless if the app still think it is in a certain resolution (like using downgraded texture, or trying to resize back the window to its precedent resolution or who knows what).

To summary, its a very risk kind of programming and I think it would not yield the expected results.


For writing on an already existing application is more easy, just make a Direct3D dll to inject in the application at start-time and before present put your Font draw call.

feal87