It should work in NT/2k and probably XP, but not on 9X.
Printable View
It should work in NT/2k and probably XP, but not on 9X.
Go to www.gamedev.net and download one of their tutorials on 3D Meshing or something. All have a dialogue that asks if you want to run the program in full screen mode or in a Window. You can just download the source and find your answer.
I doubt they are doing their 3dmeshing in a Console window though.
I believe those tutorials are by NeHe and instruct the use of OpenGL under Windows.
Thanks zen, your code seems to work perfectly, THANXXX!!!
haha, its raj! Anyhoo, Im in the same class and on the same project and I tried this:
and it managed to lock up my computer after giving a whole bunch of weird blank screens of not normal size.Quote:
Originally posted by zen
You can maximise the Win32 console with something like -
It's not the same as alt-enter, though.Code:#include <windows.h>
int main()
{
HANDLE hConsole;
COORD size;
HWND hWnd;
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
size = GetLargestConsoleWindowSize(hConsole);
SetConsoleScreenBufferSize(hConsole,size);
SetConsoleTitle("test");
hWnd = FindWindow(NULL,"test");
ShowWindow(hWnd,SW_MAXIMIZE);
//Your code
return 0;
}
Raj, I think you'd be best off just putting a cout at the start of your code telling the user to maximize the window.
Not only would it be easier, it would also be polite to do so. I am using Windows here. Windows. Not PutAllMyAppsInFullScreenOneAfterAnother-os. If I like it fullscreen, I will see to it, but for gods sake, don't hold my screen hostage with a console application. Console applications are never fullscreen. If you think it's nicer fullscreen, then make it optional to start your program with a parameter to do so. Or specifiy it in the link. Or show a message to the user saying "Press Alt-Enter for fullscreen view." Just don't zapp my screen when your program runs.Quote:
Raj, I think you'd be best off just putting a cout at the start of your code telling the user to maximize the window.
In response to some of the earlier posts on the first page, you could do anything with assembler, but you'd have to do some pretty grimy (as in, really unsheltered and close to the system) work with DEBUG. Mu suggestion is a program that came with Windows 3.1. I can put it on here as an attachment if you want (because I'm probably the only one here that actually still uses 3.1... (*feels poor* *IS poor*)). It would edit exe files and change their properties so they can, like you suggested, open in full screen mode. I'll put it on here later today!
Hi
'al+enter' can be simulated with keybd_event API
note: the VK_xxx are used for information purposes here since the kbd scan codes (second params) are used,if present instead of them.Code:keybd_event(VK_MENU,0x38,0,0);
keybd_event(VK_RETURN,0x1c,0,0);
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
hope it works 4u
damyan
tanx all, i found another function , maybe it can be help to some one like me again .
Code:// typedef function pointer for undocumented API
typedef BOOL WINAPI (*SetConsoleDisplayModeT)(HANDLE,DWORD,DWORD*);
BOOL WINAPI FullScreenConsoleNT(void)
{
// get handle to stdout
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
DWORD newmode = 1; // fullscreen mode
DWORD oldmode;
// declare instance of function pointer
SetConsoleDisplayModeT SetConsoleDisplayMode;
// get handle to kernel32.dll
HINSTANCE hK32 = GetModuleHandle("KERNEL32.DLL");
if ( hK32 == NULL ) {
// highly unlikely but good practice just the same
return FALSE;
}
// assign procedure address to function pointer
SetConsoleDisplayMode = ( SetConsoleDisplayModeT )
GetProcAddress(hK32,"SetConsoleDisplayMode");
// check if the function pointer is valid
// since the function is undocumented
if ( SetConsoleDisplayMode == NULL ) {
return FALSE;
}
// pause before changing to fullscreen
Sleep(500);
// set full screen mode
SetConsoleDisplayMode(hStdOut,newmode,&oldmode);
return TRUE;
}
By the way, the moderators generally prefer you to not bump threads older than two weeks. This thread was last active in 2002! :)
To moderators: you might want to split these posts into this other (new) thread on this topic. http://cboard.cprogramming.com/c-pro...maximised.html
[edit] That looks *very* unportable. Undocumented features are often undocumented for a reason . . . . [/edit]