Adblock breaks this site

c++ full screen

Discussion in 'Programming General' started by ET Phone Home, Jul 12, 2010.

  1. ET Phone Home

    ET Phone Home Apprentice

    Joined:
    Sep 8, 2008
    Posts:
    663
    Referrals:
    1
    Sythe Gold:
    0
    c++ full screen

    Hi i was wondering if there's a statement that you can put into a c++ file to get it to go to full screen.

    ive heard that you can simulate keystrokes with a certain statement, can you then just tell it to simulate "alt" + "enter?". If so you could just make a small function, right?


    i have windows 7 btw.

    If you post a statement/piece of code, please accompany it with the library it needs to execute if applicable
     
  2. blindkilla

    blindkilla Guru
    $25 USD Donor New

    Joined:
    Jun 22, 2005
    Posts:
    1,896
    Referrals:
    0
    Sythe Gold:
    6
    Discord Unique ID:
    282000633404456960
    Discord Username:
    sogord
    c++ full screen

    I don't think c++ has anything that allows you to simulate keys. If you were working in C# you could use the sendkeys function which does just that.

    With c++ you have to handle and detect key strokes yourself, I'm not sure if you can even do multiple keys at once to be honest. I have a console program on my desktop that works as a line editor.

    You can use a function:

    Code:
    getch()
    
    That returns the ascii code for the key pressed. You then can use a select statement to fire the specific case for each key.

    When I'm on my desktop tomorrow I'll post the keycodes.

    Edit: Looks like there is a way to do this with c++, check out the post by IllusiveMan:

     
  3. ezrafitch1990

    ezrafitch1990 Member
    Banned

    Joined:
    May 28, 2010
    Posts:
    62
    Referrals:
    0
    Sythe Gold:
    0
    c++ full screen

    Code:
    void AltEnter()
    {
        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);
        return;
    }
     
  4. handsdown23

    handsdown23 Newcomer
    Banned

    Joined:
    Jul 10, 2010
    Posts:
    13
    Referrals:
    0
    Sythe Gold:
    0
    c++ full screen

    you cant simulate ekys on c++
     
  5. Nawe

    Nawe Newcomer

    Joined:
    Aug 8, 2010
    Posts:
    23
    Referrals:
    0
    Sythe Gold:
    0
    c++ full screen

    ^ its anythink good :}
     
  6. IllusiveMan

    IllusiveMan Newcomer
    Banned

    Joined:
    Jul 18, 2010
    Posts:
    7
    Referrals:
    0
    Sythe Gold:
    0
    c++ full screen

< Need Automatic Pin Website | Creating own MMORPG >


 
 
Adblock breaks this site