#window code in C
37 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.
That looks like code for initializing a WinAPI window class
What part don't you understand?
each line
well, i get the idea that hbrBackground is the window colour
and hCursor changes cursor colour ?
All of this you can find in the documentation of WNDCLASSEX.
so you can't explain it yourself?
It would be duplicated effort to.
so, what's the point of this part of the discord?
To give enough information to solve the problem.
ok
wc1.hbrBackground = (HBRUSH) COLOR_WINDOW ; //set window background colour
wc1.hCursor = LoadCursor(NULL, IDC_ARROW); //set cursor type
is these comments right?
Kind of, but the actual explanations are in the Members section of that page.
wc1.hInstance = hInst; //A handle to the instance that contains the window procedure for the class.
this is what I got from that page
Yes, then?
i wes wondering if that was the right way to see that code
Sure.
ah ok thanks
@wise field Has your question been resolved? If so, type !solved :)
wc1.lpszClassName = L"myWindowClass1"; //window class name
naming the window?
The window title is not the window class name
ohh, so, naming the window title?
The window class describes how a window looks and functions
When you create a window, you pass in the window class name
https://learn.microsoft.com/en-us/windows/win32/learnwin32/creating-a-window
Have you read this article yet?
WinAPI works in both C and C++
i see
that actually explains better than the youtube video i copied from
the guy in the video was just like, "do this", but didn't explain the code
For Microsoft stuff, you really have to read the docs
i wondered why it looked like setting the window twice, haha
!solved