Thread: Fullscreen Shortcut

  1. #1
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318

    Fullscreen Shortcut

    Is it possible to make a shortcut that opens a program made in c++ in fullscreen mode? I only know how to do it with .bat files.

  2. #2
    Banned
    Join Date
    Jun 2005
    Posts
    594
    some dude a while back posted this, it will let you make it
    fullscreen, that is if your using windows.

    i suppose you could have a statment asking if the person want
    fullscreen and if they do run the code.

    Code:
    COORD Coord; 
    SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), CONSOLE_FULLSCREEN_MODE, &Coord);
    and

    Code:
    COORD Coord;
    SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), CONSOLE_WINDOWED_MODE, &Coord);
    i think that how it setup, ive never used it personally,
    also you will need to include <windows.h>


    if you just want a windows shortcut to make a command
    prompt fullscreen, ALT+ENTER will do that.

  3. #3
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Thanks!

  4. #4
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    But i get an error: 101 C:\Programs\Dev-Cpp\man.cpp `CONSOLE_WINDOWED_MODE' undeclared (first use this function) , 101 C:\Programs\Dev-Cpp\man.cpp `SetConsoleDisplayMode' undeclared (first use this function) , C:\Programs\Dev-Cpp\G__~1.EXE man.o: No such file or directory.

  5. #5
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361

    Wink

    #include <windows.h>
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  6. #6
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Code:
    #include <windows.h>
    #include <cstdlib>
    #include <iostream>
    
    using namespace std;
    
    int main(int argc, char *argv[])
    {
        COORD Coord; 
    SetConsoleDisplayMode( GetStdHandle( STD_OUTPUT_HANDLE ), CONSOLE_FULLSCREEN_MODE, &Coord);
        
        system("PAUSE");
        return EXIT_SUCCESS;
    }
    Errors:
    C:\Programs\Dev-Cpp\Templates\main8.cpp In function `int main(int, char**)':
    10 C:\Programs\Dev-Cpp\Templates\main8.cpp `CONSOLE_FULLSCREEN_MODE' undeclared (first use this function)
    10 C:\Programs\Dev-Cpp\Templates\main8.cpp `SetConsoleDisplayMode' undeclared (first use this function)
    C:\Programs\Dev-Cpp\G__~1.EXE Templates/main8.o: No such file or directory.
    C:\Programs\Dev-Cpp\G__~1.EXE no input files

  7. #7
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    From the MSDN

    Requirements
    Client Requires Windows "Longhorn" or Windows XP.

    This means you need a pretty new version of windows. This also means this function is probably not included with older compilers/SDKs that came out prior to XP.

    Edit:
    Note that the following thoughts are my personal oppinion and a pet peeve and don't reflect any official or unofficial programming standards or guidelines:

    It's called "Windows" for a reason. Ever heard of "Window XP" ? No. Why not ? It's "Windows", note the plural "s". Windows means I have the choice of multiple open command interfaces at the same time. By programmatically chosing fullscreen mode for your application, you assume your application is the only important thing on my mind when I start it. Guess what, it's not. Automatically opening fullscreen is contraproductive on my system. It will get the app removed real quick. There are applications I chose to open fullscreen. But that's because I made a choice. I know that many people don't even know that you can have two windows on the same screen, I always hate coming back to my PC having to resize all windows because all of them are maximized. How much better does a simple mp3 player or a Skype Window get if you have it 1200x1024 fullscreen ? If your application is better fullscreen, great. Make fullscreen the default. But give me a choice. Give me a way to turn that lousy feature off. </rant>
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  8. #8
    Banned
    Join Date
    Jun 2005
    Posts
    594
    i to tired to work on this problem right now, i found
    somethign that could possibly satisfy you?

    Code:
    #include <iostream>
    #include <windows.h>
    
    using namespace std;
    
    int main()
    {   
    	SetConsoleTitle("Console32");
    	HWND hwnd = FindWindow(NULL, "Console32");
    	SendMessage(hwnd, WM_SYSCOMMAND, SC_MAXIMIZE, 0);
    
    	cin.get();
    	return 0;
    }

  9. #9
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    Quote Originally Posted by nvoigt
    From the MSDN

    Requirements
    Client Requires Windows "Longhorn" or Windows XP.

    This means you need a pretty new version of windows. This also means this function is probably not included with older compilers/SDKs that came out prior to XP.

    Edit:
    Note that the following thoughts are my personal oppinion and a pet peeve and don't reflect any official or unofficial programming standards or guidelines:

    It's called "Windows" for a reason. Ever heard of "Window XP" ? No. Why not ? It's "Windows", note the plural "s". Windows means I have the choice of multiple open command interfaces at the same time. By programmatically chosing fullscreen mode for your application, you assume your application is the only important thing on my mind when I start it. Guess what, it's not. Automatically opening fullscreen is contraproductive on my system. It will get the app removed real quick. There are applications I chose to open fullscreen. But that's because I made a choice. I know that many people don't even know that you can have two windows on the same screen, I always hate coming back to my PC having to resize all windows because all of them are maximized. How much better does a simple mp3 player or a Skype Window get if you have it 1200x1024 fullscreen ? If your application is better fullscreen, great. Make fullscreen the default. But give me a choice. Give me a way to turn that lousy feature off. </rant>
    I make programs for myself and to learn more c++, I am not going to use everything I learn how to do, in my REAL programs. If I ever make any REAL programs.

  10. #10
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    ILoveVectors, sorry but your script didnt work for me.
    It only changed the title to Console32, nothing else...

  11. #11
    I am he who is the man! Stan100's Avatar
    Join Date
    Sep 2002
    Posts
    361
    Stan The Man. Beatles fan

    When I was a child,
    I spoke as a child,
    I thought as a child,
    I reasoned as a child.
    When I became a man,
    I put childish ways behind me"
    (the holy bible, Paul, in his first letter to the Cor. 13:11)

  12. #12
    Reverse Engineer maxorator's Avatar
    Join Date
    Aug 2005
    Location
    Estonia
    Posts
    2,318
    I am using Windows 98 SE. That example doesnt work on Windows 98.

  13. #13
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Just print a message: "Press ALT-ENTER to enter full-screen mode."
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  14. #14
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    New York
    Posts
    1,905
    Quote Originally Posted by dwks
    Just print a message: "Press ALT-ENTER to enter full-screen mode."
    Yes, I agree. That's the default hot-key to do it, so you might as well use it.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Fullscreen .exe window in Borlandc
    By mihaio07 in forum C Programming
    Replies: 3
    Last Post: 01-29-2008, 12:57 PM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  3. This is how to get your program to run fullscreen (console)
    By Raigne in forum Windows Programming
    Replies: 11
    Last Post: 11-25-2005, 08:26 AM
  4. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM