Thread: changing code to something else

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    25

    changing code to something else

    i have this code that simulates alt+enter so dos screen goes to fullscreen and i was wondering how to change it so that it simulates the user presing alt+F4. heres tge code
    Code:
    void fullscreen()          //another cool trick that I use to make it full screen or back to normal size
    {
    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);
    }
    i dont really get how i would change it can some1 please help me??
    any help is appreciated.

  2. #2

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    25
    ok i looked at that and i kindaa undeerstand the key event function thing but i cant find anything on there that shows a list of key codes, jst stuff like capslock, numlock, scroll lock and some other ones?

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Here is a link for you to read cause I am felling nice
    http://www.codeproject.com/system/keyboard.asp
    Woop?

  5. #5
    Carnivore ('-'v) Hunter2's Avatar
    Join Date
    May 2002
    Posts
    2,879
    >>simulates the user presing alt+F4
    I suppose you could simulate alt, and then f4, and then release both... or you could try getting a handle to the console window and then use PostMessage() or SendMessage() to post a WM_CLOSE message.
    Just Google It. √

    (\ /)
    ( . .)
    c(")(") This is bunny. Copy and paste bunny into your signature to help him gain world domination.

  6. #6
    Registered User
    Join Date
    Jul 2004
    Posts
    25
    thx a LOT prog i got it working perfect now

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 09-14-2006, 09:47 PM
  2. Explain this C code in english
    By soadlink in forum C Programming
    Replies: 16
    Last Post: 08-31-2006, 12:48 AM
  3. Updated sound engine code
    By VirtualAce in forum Game Programming
    Replies: 8
    Last Post: 11-18-2004, 12:38 PM
  4. Interface Question
    By smog890 in forum C Programming
    Replies: 11
    Last Post: 06-03-2002, 05:06 PM
  5. Replies: 4
    Last Post: 01-16-2002, 12:04 AM