Thread: MFC App Closing

  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
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    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, 07:11 AM
  2. Client - Server TCP/IP MFC app..... Help!
    By amedinadiaz in forum C++ Programming
    Replies: 0
    Last Post: 10-26-2005, 11:57 AM
  3. STATIC text label or LABEL in Windows APP - NO MFC!
    By triste in forum Windows Programming
    Replies: 5
    Last Post: 10-25-2004, 11:14 PM
  4. WIndows programming?
    By hostensteffa in forum Windows Programming
    Replies: 7
    Last Post: 06-07-2002, 08: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