Fullscreen
Solved
Flipody
-
blib -
blib -
Hello everyone!
Actually, I have a console application and I would like it to launch in full screen instead of in a window. I don't want the user to have to press Alt+Enter. How can I do that? A script to automatically do Alt+Enter? I'm open to it but I would need help, please...
Thank you in advance.
Have a great day everyone.
Flipody
Actually, I have a console application and I would like it to launch in full screen instead of in a window. I don't want the user to have to press Alt+Enter. How can I do that? A script to automatically do Alt+Enter? I'm open to it but I would need help, please...
Thank you in advance.
Have a great day everyone.
Flipody
3 answers
-
Voici deux bouts de code C qui permettent d'ouvrir automatiquement la console en plein écran.
(moi j'ai DEV-C++ et ces codes fonctionnent bien).
#include<windows.h>
int main(int argc , char *argv[])
{
typedef BOOL (WINAPI *PFONCTION) (HANDLE,DWORD,PCOORD);
HMODULE hDLL=LoadLibrary("kernel32.dll");
PFONCTION SetDisplayMode = (PFONCTION) GetProcAddress(hDLL,"SetConsoleDisplayMode");
HANDLE hconsole = GetStdHandle(STD_OUTPUT_HANDLE);
COORD coord;
SetDisplayMode (hconsole,1,&coord);
//Suite du code...
}
//OU la deuxieme solution qui simule ALT et ENTREE
#include<windows.h>
int main(int argc , char *argv[])
{
keybd_event(VK_MENU,0x38,0,0); //Appuie sur ALT
keybd_event(VK_RETURN,0x1c,0,0); //Appuie ENTREE
keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0); // Relache ENTREE
keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0); //Relache ALT
//Suite du code...
} -
A priori, from your code you don't have access to the window... the only solution is to change the default parameters of the console under Windows...
otherwise, from the program, it becomes more complicated... you'll have to look for the default parameters of the console and modify them through the program by writing to the registry... but that becomes annoying... last solution, you don't go through the Windows console... you create a program that runs on your own console, a simple window where you will scroll the text... -
Oki, thanks.
So a script that presses alt then enter and releases it is not possible?
Flipody