Thread: Destroying a window

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    55

    Destroying a window

    How would u close a window? its a

    case 'Q':
    case 'q':
    {
    //heres where if the user enters Q ..the code for the window to close
    }
    D4050
    Glorified C++ Programmer
    Console, DOS, HTML, Javascript, Visual Basics Compatible

  2. #2
    Registered User
    Join Date
    Oct 2001
    Posts
    55
    btw its console in MS-DOS...not win32
    D4050
    Glorified C++ Programmer
    Console, DOS, HTML, Javascript, Visual Basics Compatible

  3. #3
    Registered User ski6ski's Avatar
    Join Date
    Aug 2001
    Posts
    133
    case 'Q':
    case 'q':
    {
    exit(EXIT_SUCCESS); //here if the code for close
    }

    You might have to #include <stdlib.h> I think.
    C++ Is Powerful
    I use C++
    There fore I am Powerful

  4. #4
    Lead Moderator kermi3's Avatar
    Join Date
    Aug 1998
    Posts
    2,595
    if you just let that get you out of your loop then you may have to push enter once more, assuming that's there's a getch() of getcar() (similar) at the end of the loop but if nothing else is in the program but the loop it should end the program.
    Kermi3

    If you're new to the boards, welcome and reading this will help you get started.
    Information on code tags may be found here

    - Sandlot is the highest form of sport.

  5. #5
    Registered User
    Join Date
    Oct 2001
    Posts
    55
    thanks guys
    D4050
    Glorified C++ Programmer
    Console, DOS, HTML, Javascript, Visual Basics Compatible

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Just starting Windows Programming, School me!
    By Shamino in forum Windows Programming
    Replies: 17
    Last Post: 02-22-2008, 08:14 AM
  2. WM_CAPTION causing CreateWindowEx() to fail.
    By Necrofear in forum Windows Programming
    Replies: 8
    Last Post: 04-06-2007, 08:23 AM
  3. 6 measly errors
    By beene in forum Game Programming
    Replies: 11
    Last Post: 11-14-2006, 11:06 AM
  4. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM