Thread: fullscreen

    #1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0

    fullscreen


    im a newbie working on a windows console type program and was wondering how to go about making it run in full screen?
    thanks:confused:
  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,607
    Rep Power
    4247
    Set your focus to the console and type Alt-Enter to go to full screen mode. Type alt-enter again to go back to windowed mode.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0
    I know that much I was hoping someone could help me out with programing it to run fullscreen when you run it.

    thanks
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    There is no offical way to do this (although there is probably an undocumented function or alt-enter could not work either)
    You can make a shortcut to the program and setup "run fullscreen" there.
  8. #5
  9. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0
    I finally found a tutorial that showed an easy way to go bout it.

    http://www.subduck.com/pages/sources.php

    thought id paste it here for anyone else that may find use of it.

    #include <windows.h>

    void fullscreen()
    {
    keybd_event(VK_MENU,0x38,0,0);
    keybd_event(VK_RETURN,0x1c,0,0);
    keybd_event(VK_RETURN,0x1c,KEYEVENTF_KEYUP,0);
    keybd_event(VK_MENU,0x38,KEYEVENTF_KEYUP,0);
    }

    Thanks
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    "easy way" :D sorry iīm laughing....

    Donīt forget to SetFocus() and SetForegroundWindow() before this, or you will send the key sequence to another running program if your program doesnīt have the focus or is backgrounded... But then - in WinXPīs default configuration, SetForegroundWindow() does not work anymore :rolleyes:
    Last edited by M.Hirsch; February 16th, 2003 at 05:33 AM.
  12. #7
  13. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0
    I'm sure there are all kinds of ways to go about it. I'm not to excited with the idea of writing an app and then zip'n it up with a premade shortcut when i could just write the app to run fullscreen, and i definately wasn't gonna have a user run it hold alt and push enter everytime.
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190
    Just to make this clear: i wasnīt laughing at you but on this code and the explanations that came with it. Itīs just wrong. Also we just recently had the discussion about why not to put functions in header files. :rolleyes:

    To explain this code a little more: keybd_event() does NOT switch to fullscreen mode. It is simulating pressing keys. Here it is ALT+ENTER. In some cases this will switch your app to fullscreen. In some it just wonīt.
    Eg. it will put it back in windowed mode if you call it twice or if the user did alredy start the program in fullscreen mode. But you canīt check if it is already running in fullscreen mode either. Also it would add a page break in your Word document, if Word was the application with the focus in the moment you call this code. IMHO itīs not a good approach. But:
    I'm sure there are all kinds of ways to go about it. I'm not to excited with the idea of writing an app and then zip'n it up with a premade shortcut
    Sorry i was wrong about the shortcut. I just checked, it cannot be done like this either. Seems like your solution is the only way although i still donīt like it :( Just make sure your app is the window with the focus.

    M.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Oct 2000
    Location
    Back in the real world.
    Posts
    5,966
    Rep Power
    190

    Update: The "correct" way


    Found the function to do this on the 'net (the NT4-way should also work for W2K / WXP):

    http://www.geocities.com/nickrepin/winprog/fullscr.txt

IMN logo majestic logo threadwatch logo seochat tools logo