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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Issue with dialog

Issue with dialog

Scheduled Pinned Locked Moved C / C++ / MFC
help
4 Posts 4 Posters 1 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.
  • R Offline
    R Offline
    rajeevktripathi
    wrote on last edited by
    #1

    Hi all I am making a dialog based application. Now when we press "Esc" button then dialog is closed. Now I want to stop this activity that is if press Esc button then dialog should not be closed. Please help ( better if provide some code snippet for implementing this) Thanks

    H _ H 3 Replies Last reply
    0
    • R rajeevktripathi

      Hi all I am making a dialog based application. Now when we press "Esc" button then dialog is closed. Now I want to stop this activity that is if press Esc button then dialog should not be closed. Please help ( better if provide some code snippet for implementing this) Thanks

      H Offline
      H Offline
      happy_ram
      wrote on last edited by
      #2

      delete the CDialod::OnCancel()function in OnCancel(). -- modified at 1:53 Saturday 1st July, 2006

      1 Reply Last reply
      0
      • R rajeevktripathi

        Hi all I am making a dialog based application. Now when we press "Esc" button then dialog is closed. Now I want to stop this activity that is if press Esc button then dialog should not be closed. Please help ( better if provide some code snippet for implementing this) Thanks

        _ Offline
        _ Offline
        _AnsHUMAN_
        wrote on last edited by
        #3

        Open your application class Say Check1App and override PreTranslateMessage in this class. Add this code to the PreTranslateMessage function.

        if(pMsg->message == WM_KEYDOWN && (VK_ESCAPE == pMsg->wParam || VK_RETURN == pMsg->wParam))
        		//if(AfxMessageBox("Do you want to exit",MB_YESNO)==IDNO)
        			pMsg->wParam=VK_SEPARATOR;
        return CWinApp::PreTranslateMessage(pMsg);
        

        I hope this will solve your problem Somethings seem HARD to do, until we know how to do them. ;-) _AnShUmAn_

        1 Reply Last reply
        0
        • R rajeevktripathi

          Hi all I am making a dialog based application. Now when we press "Esc" button then dialog is closed. Now I want to stop this activity that is if press Esc button then dialog should not be closed. Please help ( better if provide some code snippet for implementing this) Thanks

          H Offline
          H Offline
          Hamid Taebi
          wrote on last edited by
          #4

          See Here[^]_**


          **_

          whitesky


          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