Simple Dialog Question

This is a discussion on Simple Dialog Question within the Windows Programming forums, part of the Platform Specific Boards category; How do I prevent my dialog boxes from quiting when the escape key is pressed/...

  1. #1
    Refugee face_master's Avatar
    Join Date
    Aug 2001
    Posts
    2,052

    Simple Dialog Question

    How do I prevent my dialog boxes from quiting when the escape key is pressed/

  2. #2
    Registered User
    Join Date
    Nov 2001
    Posts
    1,348
    There are several solutions. You could override OnClose() and only call the inherited class close function on conditions or you could disable ESE all together.

    GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, MF_ENABLED);
    GetSystemMenu(FALSE)->EnableMenuItem(SC_CLOSE, MF_DISABLED);

    Kuphryn

  3. #3
    c--
    c-- is offline
    Registered User
    Join Date
    Dec 2001
    Posts
    43
    1\ Change the ID of the Cancel Button:it Must be differ from (IDCANCEL),
    2/ and then Creat new Function that will react when you click the button (it must deffer from "OnCancel ";
    your new function will Call the virtual Function (CButton::OnCancel);
    3/ Creat new function as a member of your dialog class and its name must be OnCancel() this Function will do nothing.

    try this way!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Binary Search Trees Part III
    By Prelude in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 10-02-2004, 03:00 PM
  2. Dialog question, radio to enable control
    By fdy in forum Windows Programming
    Replies: 2
    Last Post: 05-19-2004, 10:48 PM
  3. small dialog question
    By fdy in forum C++ Programming
    Replies: 3
    Last Post: 05-18-2004, 11:03 AM
  4. Simple Dialog Box (noob)
    By tegwin in forum Windows Programming
    Replies: 6
    Last Post: 06-30-2002, 06:04 PM
  5. Tab Controls - API
    By -KEN- in forum Windows Programming
    Replies: 7
    Last Post: 06-02-2002, 09:44 AM

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