Click here to Skip to main content
15,914,417 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Full Screen, please check problem in code Pin
Nibu babu thomas14-Mar-06 20:23
Nibu babu thomas14-Mar-06 20:23 
GeneralRe: Full Screen, please check problem in code Pin
Aqueel14-Mar-06 20:36
Aqueel14-Mar-06 20:36 
GeneralRe: Full Screen, please check problem in code Pin
Nibu babu thomas14-Mar-06 20:37
Nibu babu thomas14-Mar-06 20:37 
GeneralRe: Full Screen, please check problem in code Pin
Aqueel14-Mar-06 21:16
Aqueel14-Mar-06 21:16 
GeneralRe: Full Screen, please check problem in code Pin
Nibu babu thomas14-Mar-06 22:27
Nibu babu thomas14-Mar-06 22:27 
GeneralRe: Full Screen, please check problem in code Pin
Aqueel15-Mar-06 20:04
Aqueel15-Mar-06 20:04 
GeneralRe: Full Screen, please check problem in code Pin
Nibu babu thomas15-Mar-06 20:13
Nibu babu thomas15-Mar-06 20:13 
AnswerRe: Full Screen, please check problem in code Pin
Gavin Taylor15-Mar-06 0:08
professionalGavin Taylor15-Mar-06 0:08 
On a side note, Windows is called Windows for a reason - if your going to force the user into fullscreen mode you'd be better asking them first.

Check out the MSDN documentation on SetConsoleDisplayMode[^], offically it only works on Windows XP upwards but i'm pretty sure it works on 2000 as well - it was just undocumented Smile | :)

For backwards compatibilty with other OS's you should really load it in dynamically and access it on the fly... code as follows:

typedef BOOL (WINAPI *PSCDM)(HANDLE, DWORD, PCOORD);
#define CONSOLE_FULLSCREEN_MODE 1 // From MSDN
#define CONSOLE_WINDOWED_MODE 2 // From MSDN
	
static PSCDM g_pfSetConsoleMode = NULL; // Pointer to function
static BOOL g_bSetConsoleModeLoaded = FALSE; // Have been initialised yet
	
	
/* Takes either CONSOLE_FULSCREEN_MODE or CONSOLE_WINDOWED_MODE */	
BOOL MakeMeFullScreen( DWORD dwFlags )
{
	HANDLE hStd = NULL;
	COORD co = { 0, 0 };
	
	if ( ! g_bSetConsoleModeLoaded )
	{
		HMODULE hDLL = LoadLibrary( TEXT( "kernel32.dll" ) );
	
		g_pfSetConsoleMode = ( PSCDM ) GetProcAddress( hDLL, "SetConsoleDisplayMode" );
		g_bSetConsoleModeLoaded  = TRUE;
	}
	
	if ( g_pfSetConsoleMode == NULL ) 
		return FALSE; // Not Supported by OS
	
	hStd = GetStdHandle( STD_OUTPUT_HANDLE );
	if( ( hStd == INVALID_HANDLE_VALUE ) || ( hStd == NULL ) )
		return FALSE; // Bad Handle
	
	return g_pfSetConsoleMode( hStd, dwFlags, & co );
}

Gavin Taylor
w: http://www.gavspace.com



-- modified at 6:10 Wednesday 15th March, 2006
QuestionMDI Application Pin
Subramaniam s.V.14-Mar-06 19:41
Subramaniam s.V.14-Mar-06 19:41 
AnswerRe: MDI Application Pin
Rudolf Jan15-Mar-06 1:09
Rudolf Jan15-Mar-06 1:09 
Questionopening notepad Pin
rajeev8214-Mar-06 18:56
rajeev8214-Mar-06 18:56 
AnswerRe: opening notepad Pin
Nibu babu thomas14-Mar-06 19:04
Nibu babu thomas14-Mar-06 19:04 
AnswerRe: opening notepad Pin
Aqueel14-Mar-06 19:08
Aqueel14-Mar-06 19:08 
GeneralRe: opening notepad Pin
rajeev8214-Mar-06 19:37
rajeev8214-Mar-06 19:37 
GeneralRe: opening notepad Pin
Hamid_RT14-Mar-06 20:03
Hamid_RT14-Mar-06 20:03 
AnswerRe: opening notepad Pin
Hamid_RT14-Mar-06 19:29
Hamid_RT14-Mar-06 19:29 
AnswerRe: opening notepad Pin
Rudolf Jan15-Mar-06 1:15
Rudolf Jan15-Mar-06 1:15 
Questiontrapping enter key . Pin
rajeev8214-Mar-06 18:45
rajeev8214-Mar-06 18:45 
AnswerRe: trapping enter key . Pin
Stephen Hewitt14-Mar-06 18:49
Stephen Hewitt14-Mar-06 18:49 
AnswerRe: trapping enter key . Pin
Nibu babu thomas14-Mar-06 18:50
Nibu babu thomas14-Mar-06 18:50 
GeneralRe: trapping enter key . Pin
rajeev8214-Mar-06 19:02
rajeev8214-Mar-06 19:02 
Questiondatabase Pin
J512198214-Mar-06 18:07
J512198214-Mar-06 18:07 
AnswerRe: database Pin
Stephen Hewitt14-Mar-06 18:51
Stephen Hewitt14-Mar-06 18:51 
GeneralRe: database Pin
J512198215-Mar-06 3:08
J512198215-Mar-06 3:08 
QuestionHelp needed on developing USB application Pin
tctan14-Mar-06 16:34
tctan14-Mar-06 16:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.