2
I want my program to already open in full screen when I click to run. I researched if I had how to do this and saw some recommendations to put this code at the beginning of the program
# include <windows.h>
keybd_event(VK_MENU , 0x36, 0, 0); /// no meu caso aqui é a linha 6
keybd_event(VK_RETURN, 0x1C, 0, 0);
keybd_event(VK_RETURN, 0x1C, KEYEVENTF_KEYUP, 0);
keybd_event(VK_MENU , 0x38, KEYEVENTF_KEYUP, 0);
It did not work and even started to appear this error message
error: expected declaration specifiers or '...' before numeric constant
. This message appears 4 times for each of the 4 lines (from line 6).
I learned C last year in college and I confess that I’m a little rusty, maybe it’s a simple oversight that I may not be aware of, but in my case I’m just finishing a project that I left half, and without that code works without any other error or warning. I am using codeblocks 20.03 with GNU GCC.
I would mainly like to know how to make the program already open in full screen. If there is any way to do this with or without this piece of code for me it does not matter, I thank you
Oh thank you, it worked well both ways, and thanks also for the explanation of the code snippet I sent, I didn’t know exactly what he performed
– mc-gomes