Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Escape key

Escape key

Scheduled Pinned Locked Moved C / C++ / MFC
c++
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gdocherty
    wrote on last edited by
    #1

    Hi, I've noticed that the dialog-box programs I write using Visual C++ studio exit when the escape key is pressed. Does anyone know how I can stop this. Thanks - Gary.

    G M 2 Replies Last reply
    0
    • G gdocherty

      Hi, I've noticed that the dialog-box programs I write using Visual C++ studio exit when the escape key is pressed. Does anyone know how I can stop this. Thanks - Gary.

      G Offline
      G Offline
      Graham Bradshaw
      wrote on last edited by
      #2

      You need to override the OnCancel function, and remove the call to CDialog::OnCancel.

      G 1 Reply Last reply
      0
      • G Graham Bradshaw

        You need to override the OnCancel function, and remove the call to CDialog::OnCancel.

        G Offline
        G Offline
        gdocherty
        wrote on last edited by
        #3

        Thanks alot! That's worked! - Gary.

        1 Reply Last reply
        0
        • G gdocherty

          Hi, I've noticed that the dialog-box programs I write using Visual C++ studio exit when the escape key is pressed. Does anyone know how I can stop this. Thanks - Gary.

          M Offline
          M Offline
          Michael Dunn
          wrote on last edited by
          #4

          For future reference... :) 7.4 How do I prevent a dialog from closing when the user presses Enter or Esc?[^] --Mike-- LINKS~! Ericahist | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ Strange things are afoot at the U+004B U+20DD

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups