Menu

WM_COMMAND is there something wrong??

2002-10-27
2012-09-26
  • Nobody/Anonymous

    I'm using resourcefiles so this is my DiagFunction:

    BOOL MainDiag (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
    {
        switch (message)                  /* handle the messages */
        {
            case WM_DESTROY:
                EndDialog (hwnd, 0);       /* send a WM_QUIT to the message queue */
                return TRUE;
                break;
            case WM_CLOSE:
                EndDialog (hwnd, 0);       /* send a WM_QUIT to the message queue */
                return TRUE;
                break;
            case WM_COMMAND:
                switch (LOWORD(lParam))
                {
                    case IDM_ENDE:
                         EndDialog (hwnd, 0);       /* send a WM_QUIT */
                         return TRUE;
                         break;
                    default:
                         return FALSE;
                         break;       
                }
            default:                      /* for messages that we don't deal with */
                return FALSE;
        }

        return 0;
    }

    if I hit my "ENDE" button nothing happens.. why??

     
    • Nobody/Anonymous

      I've found my problem.
      it's got to be LOWORD(wParam)

       
    • Nobody/Anonymous

      try also EndDialog("parent", "itemname");
      like Enddialog(hwnd, IDC_ENDE);

      also switch (LOWORD(wParam))
      if you dont like that try

      lParam = HIWORD;
      wParam = LOWORD;

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.