how can i get my c program to open in fullscreen?
im doing a program that is long enough but not wide enough!
how can i get my c program to open in fullscreen?
im doing a program that is long enough but not wide enough!
Last edited by akoo; Apr 2, 2007 at 07:10 PM.
WHY PAY WHEN YOU CAN GET IT FREE!!!!!
You haven't said what OS you are using, but I will assume you are using Windows. I will also assume that you are creating a console program.
One solution, that will work no matter what programming anguage you are using, is to create a short-cut to your program, and then edit the Properties of the short-cut. Just right-click on the short-cut and select Properties from the menu (Properties should be at the end of the menu). Click on the Options tab, and then choose Full Screen from the Display options. Now when you open the program using the short-cut it will open in full-screen mode.
If you want your program to switch to full screen mode using C code then I have to tell you that neither the C Programming Language nor the Standard Library have a way to do what you ask. That does not mean you can't do it, but it means you have to use other means provided by your programming environment (compiler, libraries, etc) or the OS. You did not say what programming environment you are using so I can't help you there. However
if you know how to call Windows API functions you can call the "SetConsoleDisplayMode" function from the Windows API. If you decide to try this, I can give you some help you if you need it.
I had always wondered this myself. I've been searching for pre-compiled header files, which will allow me to do this.
HTML Code:PM or link me Smartphone: Samsung Galaxy Note 8 SM-N950F CompTIA A+ Certified Laptop: Apple MacBook™ Pro ITIL v3 Certified Tablet: DELL Venue 11 Pro Apple is still the best thing since sliced bread
What programming environment are you using?
Sking, please provide a sorce code example of "SetConsoleDisplayMode" function. I don't find this in any of my default header files. how do you call this function?
HTML Code:PM or link me Smartphone: Samsung Galaxy Note 8 SM-N950F CompTIA A+ Certified Laptop: Apple MacBook™ Pro ITIL v3 Certified Tablet: DELL Venue 11 Pro Apple is still the best thing since sliced bread
I don't know what you mean by default header files but the SetConsoleDisplayMode function is defined as follows:
BOOL SetConsoleDisplayMode(
HANDLE hConsoleOutput,
DWORD dwFlags,
PCOORD lpNewScreenBufferDimensions
);
in wincon.h (you can just include windows.h, which will automatically include wincon.h). You will need to link to Kernel32.lib (I think most development environments link to this library automatically, but you might want to check).
You can find alot of information like this in the MSDN library from Microsoft.