#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0

    Weird behavior IsDialogMessage


    Hi,

    I have a program with a main window, what is in fact a modeless dialog. It is created without resources. It has an editbox, OK and Cancel button.
    To get the standard keyboard interface like modal dialogs, I use the IsDialogMessage function in the messageloop.

    The program works fine, except one case, by doing this four steps:
    - Select the Cancel button by pressing TAB
    - Deactivate the program
    - Activate the program
    - Enter the editbox
    After the moment I select the Cancel button, this gets the default button, no problem. When I enter the editbox the Ok button gets the default button, but the Cancel button too. It doesn't lose its default border.

    The attachment contains the code.

    Thanks in advance!
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0
    hmm,

    Maybe I should attach the file...

    Here it is!
    Attached Files
    Last edited by BobKid; August 13th, 2003 at 04:10 AM.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2003
    Posts
    6
    Rep Power
    0
    Have found the problem now, but it causes one new problem
    In the WindowProc of the window I use the DefWindowProc(...) function.
    This has to be the DefDlgProc(...) function and the class of the window has to be changed:
    WindowClass.cbWndExtra = DLGWINDOWEXTRA;

    The new problem is I can't close my program anymore, it doesn't respond on clicking on the close button.

    I prefer a solution where I can still use DefWindowProc(...) I think, because I don't know if I can expect more problems like this when I use DefDlgProc(...) instead of DefWindowProc(...).

    Is there anyone who can help me?

IMN logo majestic logo threadwatch logo seochat tools logo