Close identifier for WM_COMMAND?

This is a discussion on Close identifier for WM_COMMAND? within the Windows Programming forums, part of the Platform Specific Boards category; Hi, I'm trying to write a dialog procedure, with a command button that closes the dialog. However, the dialog also ...

  1. #1
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255

    Post Close identifier for WM_COMMAND?

    Hi,

    I'm trying to write a dialog procedure, with a command button that closes the dialog. However, the dialog also has a Close window button on it, and clicking this doesn't close it at the moment.

    When I positioned a breakpoint at my "switch (LOWORD(wParam)" statement and clicked the window button, wParam = 0x020003e8. Does the low word of this value equate to any constant listed in winuser.h?

  2. #2
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    your switch should look like this:

    Code:
    switch(msg)
    {
         case WM_CLOSE:
              EndDialog(hDlg, 0);
              break;
    
    ...
    }
    >> When I positioned a breakpoint at my "switch (LOWORD(wParam)"

    is that switch (LOWORD(wParam) a typo??
    cuz it should be:
    (LOWORD(wParam))
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  3. #3
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255
    Ah yes, that works, but I thought the default dialog procedure processing would've covered that one...

    Yes it was a typo in the message, although I've typed it before soooo many times I really shouldn't get it wrong! (Sigh)

  4. #4
    Registered User
    Join Date
    Jan 2002
    Posts
    387
    What default dialog procedure?
    "There are three kinds of people in the world...
    Those that can count and those that can't."

  5. #5
    Registered /usr
    Join Date
    Aug 2001
    Location
    Newport, South Wales, UK
    Posts
    1,255
    MSDN: "Although the dialog box procedure is similar to a window procedure, it must not call the DefWindowProc function to process unwanted messages. Unwanted messages are processed internally by the dialog box window procedure."

    So I'm assuming there's something in the DialogBox function that deals with those (seeing as it doesn't return a value until the dialog is closed).

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. An error is driving me nuts!
    By ulillillia in forum C Programming
    Replies: 5
    Last Post: 04-04-2009, 09:15 PM
  2. Another syntax error
    By caldeira in forum C Programming
    Replies: 31
    Last Post: 09-05-2008, 01:01 AM
  3. Game Pointer Trouble?
    By Drahcir in forum C Programming
    Replies: 8
    Last Post: 02-04-2006, 01:53 AM
  4. Why wont my function exit correctly?
    By LightsOut06 in forum C Programming
    Replies: 2
    Last Post: 10-09-2005, 09:23 PM
  5. Ghost in the CD Drive
    By Natase in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 10-12-2001, 05:38 PM

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