case WM_CREATE:
CreateWindow(
TEXT("button"), TEXT("Click"),
WS_VISIBLE | WS_CHILD | WS_BORDER,
10, 30, 55, 20,
hwnd, (HMENU) 1, NULL, NULL
);
break;
case WM_COMMAND:
if(LOWORD(wParam) == 1)
{
TCHAR szBuffer[16];
money--; //this has already been declared at 50.
_stprintf(szBuffer,_T("%d"),money);
MessageBox(hwnd, szBuffer, _T("New money value"), MB_OK); //also tried money.toString() but that doesn't work either.
}
break;
.ToString is .NET stuff. Won't work in Win32.
I like to start control ids at 1500, so they don't interfere too badly with MS defined values. Also, use equates...
#define IDC_BUTTON1 1500
Also, for that to compile you should include....
#include
#include
#include
Let me know if it doesn't work. Maybe I missed something else...