Link to home
Start Free TrialLog in
Avatar of rdrunner
rdrunner

asked on

How to force a DX-Fullscreen App into windowed mode?

Can anyone here tell me if that is possible or not?

I know i CAN be done but HOW?

Please folks - Enlighten me


Thanks
Avatar of makkbru
makkbru

Are you talking about programming a fullscreen app that can be changed into a window or changing for instance halflife into windowed mode....

if you are talking about programming you have to reinitialize the device with  windowed = true...
Avatar of rdrunner

ASKER

I mean the 1st.....

Forcing someone elses APP into a windowed mode...

sorry dont know how to do that.... u probably need a program to do that...
Just release your D3D Device and create a new one in the desired mode. IIRC correctly there's also an Reset() method.
So this is a fullscreen DX application that you don't have the source to, if I understand you correctly.

The short answer is No, it is not possible.

The long answer is that without some sort of an emulator or wrapper, it is not possible.
In Linux, using Wine, you can run full screen DirectX applications in a window, the reason is that it's really still full screen but the whole screen is emulated inside a window.

The reasons for this inability is how you set up drawing in full-screen and windowed mode.  Besides just the resolutions and other problems, when you are in windowed mode your primary surface is still the whole screen.

Why is that a problem?  Well it's a problem because you can and *will* draw outside your window.  It can be useful for a screensaver or something, but generally it's not what you want to do.

To get around this you have to have support for it in the program (source code).  The programmer sets up a clipping object that keeps them from drawing outside a given area.  Also they have to keep track of where their area to draw is, because 0,0 is no long the top left of their window, but the top left of the screen.. perhaps they can only really start drawing at 250,200 or something.

I hope this helps you understand the situation.  Any clarifying questions?
Thats correct.. No source available....

I am only wondering about this since it was already done to some games (so tecnically it is possible -> DAOC/EQ). The only question i have left then is how do you emulate fullscreen in a window ;)
ASKER CERTIFIED SOLUTION
Avatar of PurpleFlux
PurpleFlux

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Looks like i have to settle for this ;)
This may be kinda obvious, but some graphics programmes allow you to press Alt-Enter to toggle between  full and windowed mode. Try this at least.

Dean
if you want to run windowed, your main resolution has to be larger than the App's resolution
Well, you could maybe check a "proxy-dll" approach. See http://www.proxy.mikoweb.de
Using a proxy-dll, calls to DX are intercepted. You could maybe change the creation parameters of the device, thus trying to force it into windowd mode.
Nothing is 'impossible.' Some things would require more work than others.

Recently a friend of mine did it to a game (www.darkages.com). The client is a forced windowed mode in 640x480. There is windowed mode built into the client, but enabled the command line option (hexing the exe) didn't work as they had a "check" to ensure it was in fullscreen.

How was it done? Using a little ASM/C, code was injected to the game (launched by CreateRemoteProcess) and a clipper was attached to the drawing window. The game used Blt already, so we didn't have to change from BltFast to Blt, but there were still a few issues we had to work with (such as making the cursor redraw on WM_PAINT messages and making it Sleep(0) as needed).

Nothing is impossible, learn ASM and you can do nearly anything you want with a little (ok, a good bit) research and poking around.