Advertisement
dmilicev

full_screen_mode_console_window_v1.c

May 18th, 2020
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.89 KB | None | 0 0
  1. /*
  2.  
  3.     full_screen_mode_console_window_v1.c
  4.  
  5. https://stackoverflow.com/questions/4053554/running-a-c-console-program-in-full-screen
  6. https://superuser.com/questions/285984/how-do-i-full-screen-my-cmd
  7. https://www.google.com/search?q=c+code+command+to+open+the+console+in+full+screen
  8.  
  9. There are not a lot of video adapters around these days that still support this.
  10. Run cmd.exe and press Alt+Enter.
  11. If you get a message box that says "This system does not support fullscreen mode"
  12. then you're done.
  13. If it does switch to full screen then you can use
  14. SetConsoleDisplayMode() in your main() function.
  15. Of course, you don't know what your customer's machine is like, best not to pursue this.
  16.  
  17. mode /?
  18.  
  19. Configures system devices.
  20.  
  21. Serial port:       MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s]
  22.                                 [to=on|off] [xon=on|off] [odsr=on|off]
  23.                                 [octs=on|off] [dtr=on|off|hs]
  24.                                 [rts=on|off|hs|tg] [idsr=on|off]
  25.  
  26. Device Status:     MODE [device] [/STATUS]
  27.  
  28. Redirect printing: MODE LPTn[:]=COMm[:]
  29.  
  30. Select code page:  MODE CON[:] CP SELECT=yyy
  31.  
  32. Code page status:  MODE CON[:] CP [/STATUS]
  33.  
  34. Display mode:      MODE CON[:] [COLS=c] [LINES=n]
  35.  
  36. Typematic rate:    MODE CON[:] [RATE=r DELAY=d]
  37.  
  38.  
  39.     You can find all my C programs at Dragan Milicev's pastebin:
  40.  
  41.     https://pastebin.com/u/dmilicev
  42.  
  43. */
  44.  
  45. #include <stdio.h>
  46.  
  47. int main(void)
  48. {
  49.     system("MODE 650"); // try with other numbers, 10, 30, 80, ...
  50.     system("MODE CON: /STATUS");
  51.     printf("\n This is console full screen mode. \n\n");
  52.     system("PAUSE");
  53.  
  54.     system("MODE CON: COLS=50 LINES=20");
  55.     system("MODE CON: /STATUS");
  56.     printf("\n This is console mode COLS=50 LINES=20 \n\n");
  57.     system("PAUSE");
  58.  
  59.     system("MODE CON: COLS=80 LINES=30");
  60.     system("MODE CON: /STATUS");
  61.     printf("\n This is console mode COLS=80 LINES=30 \n\n");
  62.  
  63.     return 0;
  64.  
  65. } // main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement