• Log in or sign up for an account here: https://www.sythe.org/login

c++ full screen

ET Phone Home

Apprentice
Joined
Sep 8, 2008
Sythe Gold
0
Messages
663
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
 
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:

News flash!
C++ can execute Windows API. -_-
Even if there is no native cross-platform method, you can simulate keystrokes.
This appears to be a Sendkeys imitation class: http://www.codeproject.com/KB/cpp/sendkeys_cpp_Article.aspx
Note: I haven't tested this, but looks legit.
 
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;
}
 
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;
}

^ its anythink good :}
 
Runescape Gamblingrunescape gambling
Back
Top