Switch(LOWORD(wParam) does not work..

This is a discussion on Switch(LOWORD(wParam) does not work.. within the Windows Programming forums, part of the Platform Specific Boards category; Hello everyone! I know C++ pretty well, and a command i use often is not working (I'm finally making the ...

  1. #1
    Registered User
    Join Date
    Aug 2010
    Posts
    2

    Switch(LOWORD(wParam) does not work..

    Hello everyone! I know C++ pretty well, and a command i use often is not working (I'm finally making the switch to GUI programming)

    Here is the code that is not working:
    Code:
                   
     case WM_COMMAND:
                 switch(LOWORD(wParam));
                  {
                   case ID_SAVE_ANIM:
                         MessageBox(hwnd, "This feature is not yet implemented", "Error", MB_OK | MB_ICONERROR);
                   break;
                   case ID_FILE_EXIT:
                        PostMessage(hwnd, WM_CLOSE, 0, 0);
                   break;
          }
    The IDs:
    Code:
    #define IDR_MYMENU 101
    #define IDI_MYICON 201
    #define ID_FILE_EXIT 9001
    #define ID_SAVE_ANIM 9002
    #define ID_OPEN_ANIM 9003
    #define ID_FILE_NEW 9004
    #define ID_LOAD_BG 9005
    #define ID_LOAD_FT 9006
    #define ID_CREATE_FT 9007
    #define ID_CANVAS_SIZE 9008
    #define ID_PREFERENCES 9009
    #define ID_README_FILE 9010
    #define ID_UPDATE_CHECK 9011
    #define ID_ABOUT 9012
    #define ID_CLEAR_BG 9013
    what is happening is this:
    if I click "Exit" (ID_FILE_EXIT) it just does the ID_SAVE_ANIM parT (Not implemented thing).

    The full code can be posted upon request. What is wrong? If you need screenshots, i can send some..
    Last edited by pivotraze; 08-09-2010 at 11:52 AM.

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,452
    > switch(LOWORD(wParam));
    Spot the ; at the end of the line?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. strcmp returning 1...
    By Axel in forum C Programming
    Replies: 12
    Last Post: 09-08-2006, 07:48 PM
  2. getline() don't want to work anymore...
    By mikahell in forum C++ Programming
    Replies: 7
    Last Post: 07-31-2006, 10:50 AM
  3. Why don't the tutorials on this site work on my computer?
    By jsrig88 in forum C++ Programming
    Replies: 3
    Last Post: 05-15-2006, 10:39 PM
  4. fopen();
    By GanglyLamb in forum C Programming
    Replies: 8
    Last Post: 11-03-2002, 11:39 AM
  5. DLL __cdecl doesnt seem to work?
    By Xei in forum C++ Programming
    Replies: 6
    Last Post: 08-21-2002, 04:36 PM

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