text: Hello,\n\nYou have to check for the event WM_COMMAND in your switch instruction. And inside that case, check the wParam value (High order byte) of the event to make sure it is a BN_CLICKED event. At that stage, you need to further identify your button using the wParam (Low order byte) of the wParam.\n\nExample:\n\n        case WM_COMMAND: \n          if (HIWORD(wParam) == BN_CLICKED) \n          { \n                switch (LOWORD(wParam)) \n                { \n                    case ID_OF_YOUR_BUTON: \n                        MessageBox(hwnd, "Hello", "Testing", MB_OK);\n \n                        break; \n                } \n          } \n          break; \n\n\nI suggest that you take a look to the doc of VC++ on these events, mainly in the Windows SDK doc about Buttons. It is well done with code samples.\n\nAdditional note: as you created your button directly on a window instead of within a dialog box, it is very likely that you used a call to the CreateWindow function to create it. In this case, you give the ID number in parameter HMENU hMenu of the function. You may create a Resource ID (it is just an value globally defined with #define) to avoid playing with numbers when you have several controls.\n\nRegards,\nChris.\nhttp://www.beinsoft.com