CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2009
    Posts
    14

    Full Screen Mode.

    Ok, I have searched google/yahoo for a while and i have not been able to find a working example of how to make the application go into full screen mode. such as if a user pressed alt+enter
    help please.

    -Thank you

  2. #2
    Join Date
    Apr 2007
    Location
    Mars NASA Station
    Posts
    1,436

    Re: Full Screen Mode.

    Basically, the idea is like this
    calculate(detect) the maximum of pixel in terms of horizontal and vertical, follow by resize it to the maximum pixel the monitor allowed.

    I think there are few library that help you do it.
    Thanks for your help.

  3. #3
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Full Screen Mode.

    Quote Originally Posted by Peter_APIIT View Post
    Basically, the idea is like this
    calculate(detect) the maximum of pixel in terms of horizontal and vertical, follow by resize it to the maximum pixel the monitor allowed.

    I think there are few library that help you do it.
    That has absolutely nothing to do with the question...

    Full Screen (non-windowed) mode is a fairly specialized case, but there is plenty of information on MSDN
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  4. #4
    Join Date
    Mar 2008
    Posts
    30

    Re: Full Screen Mode.

    this is the emulation of alt+enter

    Code:
    #include <windows.h>
    
    void fullscreen() {
         keybd_event(VK_MENU, 0x38, 0, 0);
         keybd_event(VK_RETURN, 0x1c, 0, 0);
         keybd_event(VK_MENU, 0x38, KEYEVENTF_KEYUP, 0);
         keybd_event(VK_RETURN, 0x1c, KEYEVENTF_KEYUP, 0);
    }

  5. #5
    Join Date
    Nov 2003
    Posts
    1,902

    Re: Full Screen Mode.

    >> this is the emulation of alt+enter
    Don't use hard-coded constants like that.
    Code:
    // Simulate ALT-ENTER keystrokes
    void AltEnter()
    {
        // NOTE: This method only works if the console window has the keyboard 
        //       focus and the user isn't hitting keys on the keyboard.
        SetForegroundWindow(GetConsoleWindow()); 
        keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), 0, 0); 
        keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), 0, 0); 
        keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, 0), KEYEVENTF_KEYUP, 0); 
        keybd_event(VK_MENU, MapVirtualKey(VK_MENU, 0), KEYEVENTF_KEYUP, 0); 
    }//AltEnter
    There's no need to simulate key strokes on XP and up.
    http://msdn.microsoft.com/en-us/libr...28(VS.85).aspx

    gg

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured