Window stay!

This is a discussion on Window stay! within the C++ Programming forums, part of the General Programming Boards category; I know how to get the window to close when you press a letter and then enter but is it ...

  1. #1
    Registered User Octorok101's Avatar
    Join Date
    May 2002
    Posts
    22

    Question Window stay!

    I know how to get the window to close when you press a letter and then enter but is it possable to have it close when you press escape?

  2. #2
    Registered User Azuth's Avatar
    Join Date
    Feb 2002
    Posts
    236
    #include <stdio.h>
    #include <conio.h>

    Code:
    int main()
    {
    char c;
    	while (c!='q')
    	{
    	c=getch();
    	printf ("%i",c);
    	}
    	return 0;
    }
    Here's a horrible little bit of code I threw together that may give you an idea. You may be particularly interested in the number that appears when you press esc.
    q exits
    Demonographic rhinology is not the only possible outcome, but why take the chance

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  2. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 10:06 AM
  3. My Window Class
    By Epo in forum Game Programming
    Replies: 2
    Last Post: 07-10-2005, 02:33 PM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. problem with open gl engine.
    By gell10 in forum Game Programming
    Replies: 1
    Last Post: 08-21-2003, 04:10 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21