Change OTHER applications to Windowed Mode

Started by
9 comments, last by ApochPiQ 18 years, 3 months ago
I am wondering how you would programmatically change another application from full screen mode to full screen windowed mode. Is it even possible? I would assume so as I've seen games such as World of Warcraft have full screen windowed mode.
Advertisement
I'm not sure if it's possible, but WoW has an option that lets you open it in a window, it's not being done by another program.
It is possible if the two applications know about each other. In Windows you may send messages (or some other interprocess communication methods) between windows.

If it is not the case then hacking would be another possible approach, *shrug* I am not really sure how to do it though. Maybe you have to modify the process memory data, but it is dangerous [headshake].
--> The great thing about Object Oriented code is that it can make small, simple problems look like large, complex ones <--
Related question/answer
The safest way would be to figure out where the program keeps its settings, change the settings to the fullscreen/windowed mode you want, and restart the other program. Anything beyond that would get very arcane and very risky, and would only work for one program (you'd have to come up with a new trick for each one you want to toggle).

Unless, of course, you're writing the graphics app in question, in which case you can choose from any of the Windows inter-process communication techniques to send the required signal from your remote-control app.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

After reading that experts-xchange link below, I was a little disheartened. However, I definitely think it is still possible. I am mainly looking to change these display settings for one application, so a direct hack approach would be just. I am a mediocre reverse engineer and can go code in the settings changes if I knew what they were. I'm pretty sure the game uses DirectX.

Any idea what kind of API i'm looking for to change the mode? or any other tricks that might work, ApochPiQ?

Edit:
If I knew the API that made it full/windowed mode, I think it would work. I want this application to be fullscreen windowed mode (so basically windowed mode, with no border and no control box and can't move or resize). This would simulate the effect of full screen, but would allow me to move my mouse off the edge and go to my second monitor.

[Edited by - devINVISIBLE on January 3, 2006 1:46:38 PM]
6F0D0912 |. 51 PUSH ECX ; /lParam
6F0D0913 |. 56 PUSH ESI ; |hInst
6F0D0914 |. 6A 00 PUSH 0 ; |hMenu = NULL
6F0D0916 |. 8BD3 MOV EDX,EBX ; |
6F0D0918 |. F7DA NEG EDX ; |
6F0D091A |. 1BD2 SBB EDX,EDX ; |
6F0D091C |. 6A 00 PUSH 0 ; |hParent = NULL
6F0D091E |. 81E2 0000C780 AND EDX,80C70000 ; |
6F0D0924 |. 33C0 XOR EAX,EAX ; |
6F0D0926 |. 68 00000080 PUSH 80000000 ; |Height = 80000000 (-2147483648.)
6F0D092B |. 81C2 00000886 ADD EDX,86080000 ; |
6F0D0931 |. 68 00000080 PUSH 80000000 ; |Width = 80000000 (-2147483648.)
6F0D0936 |. 85DB TEST EBX,EBX ; |
6F0D0938 |. 0F95C0 SETNE AL ; |
6F0D093B |. 68 00000080 PUSH 80000000 ; |Y = 80000000 (-2147483648.)
6F0D0940 |. 68 00000080 PUSH 80000000 ; |X = 80000000 (-2147483648.)
6F0D0945 |. 52 PUSH EDX ; |style
6F0D0946 |. 68 046C7E6F PUSH Game.6F7E6C04 ; |WindowName = "Warcraft III"
6F0D094B |. 68 A8C9706F PUSH Game.6F70C9A8 ; |Class = "Warcraft III"
6F0D0950 |. 48 DEC EAX ; |
6F0D0951 |. 83E0 08 AND EAX,8 ; |
6F0D0954 |. 0D 00000400 OR EAX,40000 ; |
6F0D0959 |. 50 PUSH EAX ; |Extstyle
6F0D095A |. FF15 7454706F CALL DWORD PTR DS:[<&USER32.CreateWindowExA>] ; \CreateWindowExA


Is the CreateWindow function call. I'm not sure if its those parameters or parameters to a directx call that will make the difference.
After creating the window, the application loads the d3d8thk.dll. Looking into this a little bit I found these links.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/lowlevelclientsupport/dxlowlevelclientsupport.asp
"Several techniques are available to make an application portable across operating systems. The most robust is to install the Microsoft DirectX 8.x redistributable package on Windows 2000 as part of your own application's install process. This guarantees that D3D8THK.DLL will be available on Windows 2000 systems and allows a single code-path in the application, because you can use the same technique as described for Windows XP above.

Applications can also build their own insulating dynamic-link library (DLL) and implement two versions of that DLL, one for Windows 2000 using the technique shown above and one for Windows XP that uses D3D8THK.DLL."

In Gdi32.dll and Ddraw.dll, this is achieved by calling DdCreateDirectDrawObject, DdQueryDirectDrawObject and DdReenableDirectDrawObject. In Direct3D 8.x, this is achieved by calling NtGdiDdCreateDirectDrawObject, NtGdiDdQueryDirectDrawObject and NtGdiDdReenableDirectDrawObject. Note that the GdiEntry* entry points are merely marshallers for the kernel-mode entry points.

http://www.osronline.com/DDKx/graphics/ddfncs_6bdz.htm
K... the call that actually changes the dx app to full screen is ChangeDisplaySettingsEx. I am still unsure if my hack will have to occur in the structure passed to this function or the CreateWindowEX function still.
It is possible. Myself and a friend wrote a program to run Starcraft in a window (I did the reverse-engineering and came up with the method to do it, and my friend wrote the code and did the bugsquashing). That was using DirectDraw, but a similar method would be used for Direct3D.

This topic is closed to new replies.

Advertisement