Win32 How to have Text Box output a variable

Willard 45 Reputation points

I have created a text box through CreateWindowEx and mostly understand how to. Now i'm attempting to do the same thing, but outputting text from a variable, for example.

int main
	int x = 20
	std::cout << "You have " << x << " cats\n";

	return 0;
Windows API - Win32
Windows API - Win32
A core set of Windows application programming interfaces (APIs) for desktop and server applications. Previously known as Win32 API.
2,069 questions
A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,906 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 71,866 Reputation points

    For example, with an Edit control with ID = 12 :

    int n = 20;
    SetDlgItemInt(hWnd, 12,	n, FALSE);
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful