Basically, I need to figure out how to change a buttons text when its clicked(X or O).

button1 = CreateWindow(TEXT("BUTTON"), TEXT("1"), WS_CHILD | WS_VISIBLE | BS_DEFPUSHBUTTON, 10, 10, 50, 50, 
					  hwnd, (HMENU)ID_BUTTON1, myInst, NULL);

Im using buttons like this. I have it set up in the WM_COMMAND case in the winProc, but I dont know what code to write, and I cant find anything on googling it.

case WM_COMMAND:

			switch(LOWORD(wParam))
			{
				case ID_FILE_EXIT:
					exit(1);

				case ID_BUTTON1:
				//What goes here to change the text
   
				case ID_BUTTON2:

				case ID_BUTTON3:

				case ID_BUTTON4:

				case ID_BUTTON5:

				case ID_BUTTON6:

				case ID_BUTTON7:

				case ID_BUTTON8:

				case ID_BUTTON9:					
					
			}

Thanks!

Recommended Answers

All 3 Replies

Try SetDlgItemText

Anyone?

hi,
Do you want to make an application using AI = Artificial intelligence, or this game is only for two human users?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.