MFC App Closing

This is a discussion on MFC App Closing within the Windows Programming forums, part of the Platform Specific Boards category; Hi, this is probably a silly question but I can't seem to find what is happening. I have an MFC ...

  1. #1
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128

    MFC App Closing

    Hi,

    this is probably a silly question but I can't seem to find what is happening. I have an MFC app with 3 edit boxes, when you press return in any of the edit boxes it just closes the app, the cancel button is not highlighted.

    Thanks.
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

  2. #2
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,598
    Even though the buttons are not highlighted you have one of them set as the default button. The default behavior of the dialog box is to close on enter. So just intercept WM_CLOSE and do something different.

    You are closing the dialog box because the dialog is receiving the enter key and not the edit controls. Also you will want to check Want return on the edit controls. I don't normally use this on edit controls, but you can.

  3. #3
    ResurgentBarbecue UnclePunker's Avatar
    Join Date
    May 2002
    Posts
    128
    Thank you, i was right it was a silly question. Thanks again for the help.
    Compiler == Visual C++ 6.0
    "Come Out Fighting."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. non-MFC DLL with MFC app question.
    By Kempelen in forum Windows Programming
    Replies: 10
    Last Post: 08-20-2008, 08:11 AM
  2. Client - Server TCP/IP MFC app..... Help!
    By amedinadiaz in forum C++ Programming
    Replies: 0
    Last Post: 10-26-2005, 12:57 PM
  3. STATIC text label or LABEL in Windows APP - NO MFC!
    By triste in forum Windows Programming
    Replies: 5
    Last Post: 10-26-2004, 12:14 AM
  4. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 09:52 PM
  5. Closing down Lotus Notes from a MFC app
    By Kev in forum Windows Programming
    Replies: 0
    Last Post: 02-13-2002, 05:26 PM

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