Jump to content
The Dark Mod Forums
Sign in to follow this  
STiFU

Minimizing TDM

Recommended Posts

Hey, I sometimes find myself wanting to minimize The Dark Mod for a very short time, but as you all know, that doesn't work quite so good. There are a couple of tools you can run simultaneously to get Doom 3 to minimize, but this is not as comfortable as built in minimizing capability and since we have to start TDM via your launcher anyway, couldn't it be included there? So today I ran over a little codesnippet that uses the win32 API to add the missing minimizing functionality, which could maybe be worked into your launcher. Here it is:

#include <windows.h>
#include <stdio.h>
int d3found=0;
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR nCmdLine,int nShowCmd)
{
HWND doom3=(HWND)0;	
FILE * d3exist;
d3exist = fopen("Doom3.exe","r");
if (d3exist == 0)
	return 0;

fclose(d3exist);
ShellExecute(0,"open","Doom3.exe",0,0,SW_SHOWNORMAL);
while(1)
{
	if (GetAsyncKeyState(VK_MENU) && GetAsyncKeyState(VK_TAB))
	{
		doom3 = FindWindow("DOOM3",0);
		if (doom3)
		{
			d3found=1;
			ShowWindow(doom3,SW_MINIMIZE);
		}
		else
			d3found=0;
	}
	if (doom3 != 0 && d3found == 1)
	{
		doom3 = FindWindow("DOOM3",0);
		if(!doom3)
			return 0;
	}
	Sleep(10);
}
return 0;
}

I don't know much about effective "window-programming" and such stuff, so please forgive me if this snippet is bullshit as far as performance is concerned or even compability to your current launcher. I am assuming something similar could be achieved for linux distributions. What do you think?

(Uhm, the codetags do some awkward formatting. It looked ok in my editor...)

Edited by STiFU

Share this post


Link to post
Share on other sites

Just scanning through it, I don't see anything obviously wrong. The thing is: Doom 3 doesn't like losing window focus very much.

 

What I've done is just run TDM in windowed mode, so I can have the debugger running in the background. Or I can tweak entity/texture definitions during runtime and reloadDecls without going through the hassle of start/restart.

 

One of these days, I'll have to see if I can minimize Crysis: Warhead without making my midtower explode. :laugh:


yay seuss crease touss dome in ouss nose tair

Share this post


Link to post
Share on other sites

I put TDM in windowed mode when I'm using Dark Radiant.


|=-=------=-=|

happycheeze.deviantart.com

 

Moddb

 

Gamers Outreach, a nonprofit that uses videogames to raise money for chairty.

|=-=------=-=|

Share this post


Link to post
Share on other sites

Alt+tabing Doom 3 in windowed mode doesn't work for me, but that could be a win 7 issue. I only see the taskbar on toplevel, but cannot access anything else. But the Snippet works perfectly and most notably without those gamma problems, you got going in good old quake 3 times. It doesn't change the resolution though when switching to windows, so you get the best results if you play on the same resolution you got configured in windows. I am going to compile an executable from that little code later, that will start the tdm_launcher instead of doom3.exe. I guess I will just have to alter the ShellExecute- and FindWindow-lines.

 

Anyway, I thought Minimizing support would be a nice little bonus-feature for your Launcher. Maximum comfort and so on... ;)

Edited by STiFU

Share this post


Link to post
Share on other sites

Alt+tabing Doom 3 in windowed mode doesn't work for me, but that could be a win 7 issue. I only see the taskbar on toplevel, but cannot access anything else. But the Snippet works perfectly and most notably without those gamma problems, you got going in good old quake 3 times. It doesn't change the resolution though when switching to windows, so you get the best results if you play on the same resolution you got configured in windows. I am going to compile an executable from that little code later, that will start the tdm_launcher instead of doom3.exe. I guess I will just have to alter the ShellExecute- and FindWindow-lines.

 

Anyway, I thought Minimizing support would be a nice little bonus-feature for your Launcher. Maximum comfort and so on... ;)

 

I'd like to try how it works. I have to turn off Aero to be able to switch between fullscreen and window mode (otherwise Doom/TDM goes grey). Alt+tabbing is also sometimes tricky for me in Win7.

Share this post


Link to post
Share on other sites

Alt-tabbing windowed mode works okay for me in Win7, but usually in windowed mode the resolution is lower than that of my desktop so there is a good amount of space around the window to click outside of it. Not sure if that matters.

Share this post


Link to post
Share on other sites

An old post, but what's new...? Are there any possibilities for minimization nowadays? Without running in windowed mode. I'm on Win8.0.

 

Is it easy enough to use this code STiFU, a beginner developer? I'm not the most adept coder, and certainly not accustomed to the Windows API, indeed I only run Windows atm because TDM works better for me like that :). Any clues would be appreciated.

 

I used to use etminimizer back in the day, for Wolf ET - Quake 3 engine.

Edited by chrisinpants

Share this post


Link to post
Share on other sites

The above solution is rather dirty... Serpentine did some work on giving tdm minimizing capability in v1.08. However, it never really worked for me. Here is the bugtracker issue. Maybe the author himself could say what the deal is here.

Share this post


Link to post
Share on other sites

I've found a way to switch windows when playing in fullscreen mode without any add-ons or scripts, but it's a few keypresses, not one:

 

CTRL+ALT+DEL > task manager > right-click darkmod > minimize.

 

The game will resume in fullscreen when you click on it in the taskbar.

Edited by SteveL
  • Like 2

Share this post


Link to post
Share on other sites

I think the solution shouldn't assume that the game is called "doom3.exe".

Not any more, but it was 3 years ago when that post was written

Share this post


Link to post
Share on other sites

In case it helps anyone, there's an AutoHotkey-based tip for making TDM appear fullscreen while it's actually in windowed mode here: http://forums.thedar...post__p__322484

 

If you've already got AHk, it's a doddle to install. Works for other games too (I use it for Miasmata, which had even more issues with alt-tabbing than TDM).

Share this post


Link to post
Share on other sites

With Windows XP I suppose ? Doesn't work with Win 7.

 

I am Windows 7 too... Damn, was hoping it didn't work just for me! A post in the another related thread I was just reading suggested you need to have the "always on top" option enabled in Windows task manager for it to work. As it happens, I don't have that enabled, and it does work for me, but that's something else you could try.

Share this post


Link to post
Share on other sites

It does not apply to Windows users, but Linux users can start a second X server.

 

For example I use:

$ xinit /usr/bin/wine TheDarkMod.exe -- :1

 

So iconizing is not really needed as you can simply switch between the two X servers. (eg. CTRL-ALT-F7 and CTRL-ALT-F8)

Share this post


Link to post
Share on other sites

It does not apply to Windows users, but Linux users can start a second X server.

 

For example I use:

$ xinit /usr/bin/wine TheDarkMod.exe -- :1

 

So iconizing is not really needed as you can simply switch between the two X servers. (eg. CTRL-ALT-F7 and CTRL-ALT-F8)

 

Alas, that didn't work for me:

X: user not authorized to run the X server, aborting.

and I'm not inclined to try running thedarkmod as root. By the way, why wine? When I was running TDM under wine I was always able to Alt-Tab away, or at least switch desktop, without problems anyway.

 

Edit: Well, I tried editing /etc/X11/Xwrapper.config and changing allowed_users=console to allowed_users=anybody, and that did allow TDM to start ... but there was no sound. Ho hum.

Edited by Araneidae

Share this post


Link to post
Share on other sites

Don't know if it's related, but got a couple of error messages from xorg when I restarted after editing /etc/group ...

I have no idea, but since in my computer there is no /etc/X11/Xwrapper.config at all I guess it is all connected to over-complications on your distro.

Edited by ezze

Share this post


Link to post
Share on other sites

I wonder where I learned about alt+enter, and why it it not mentioned here...?

 

Awesome!

That is just what I need.

Or at least the best option so far.

 

Edit:

oh well. Just having tried it and responded here.

Next thing to happen was TDM hanging up when hitting Alt-Enter again to get back to fullscreen.

Edited by gnartsch

Share this post


Link to post
Share on other sites

It looks like computing loaded map is too much stress in some cases. I tried to open menu screen first, but switching fullscreen/ windowed works slowly anyway.


S2wtMNl.gif

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...