Win32 How to have Text Box output a variable

Willard 45 Reputation points
2023-05-10T16:04:35.9233333+00:00

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,416 questions
C++
C++
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.
3,525 questions
0 comments No comments
{count} votes

Accepted answer
  1. Castorix31 81,636 Reputation points
    2023-05-10T18:06:21.31+00:00

    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