Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Minimizing a DOS box in software

0 views
Skip to first unread message

John Kleint

unread,
Jul 9, 1997, 3:00:00 AM7/9/97
to

I am looking for some code to minimize a DOS box without pressing
ALT-ENTER. I have tried stuffing the keyboard buffer, but it doesn't
work. Anybody know of a Win32 function call to minimize a DOS box, or
(preferably) to toggle between full-screen and windowed mode?

Robert Schlabbach

unread,
Jul 10, 1997, 3:00:00 AM7/10/97
to

John Kleint <jkl...@mail.sdsu.edu> wrote in article
<33c33047.1267559@news>...

There is no officially documented function for this. However, the following
code demonstrates the undocumented function in Windows NT (Intel only,
RISCs don't have a full-screen mode!):

/* This sample demonstrates the undocumented functions
GetConsoleDisplayMode() and
SetConsoleDisplayMode()
to set a console window to full-screen and query
the current full-screen/windowed status */

#include <windows.h>

WINBASEAPI
BOOL
WINAPI
GetConsoleDisplayMode(
LPDWORD dwConsoleDisplayMode
);

WINBASEAPI
DWORD
WINAPI
SetConsoleDisplayMode(
HANDLE hConsoleHandle,
DWORD dwConsoleDisplayMode,
LPDWORD dwPreviousDisplayMode
);

void main(void)
{
HANDLE hConsole;
DWORD Result;

AllocConsole();
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleDisplayMode(hConsole, 1, &Result);
};

Well, it doesn't really "demonstrate", it just switches a windowed DOS-box
to full-screen. You can play with the functions.

Still, I'd discourage anyone from making any use of this.
Windowed/full-screen is a USER PREFERENCE, that's probably what Microsoft
thought, too, and thus left the functions undocumented.

Regards,
--
Robert Schlabbach
e-mail: rob...@powerstation.isdn.cs.TU-Berlin.DE
Technical University of Berlin, Germany


emai...@spam.not

unread,
Jul 10, 1997, 3:00:00 AM7/10/97
to

On 10 Jul 1997 22:03:41 GMT, "Robert Schlabbach"
<rob...@powerstation.isdn.cs.TU-Berlin.DE> wrote:

>Still, I'd discourage anyone from making any use of this.
>Windowed/full-screen is a USER PREFERENCE, that's probably what Microsoft
>thought, too, and thus left the functions undocumented.

If Microsoft cared about user preferences, they would have given the user a
defense against programs stealing focus. But they see it as a user preference
to run such programs in the first place. Likewise, it's a user preference to
run a program that changes the user's settings.


0 new messages