Quote Originally Posted by WaterSerpentM View Post
can someone explain this code for me:

Code:
    WNDCLASSEXW wc = {0};


    wc.hbrBackground = (HBRUSH) COLOR_WINDOW ;
    wc.hCursor = LoadCursor(NULL, IDC_ARROW);
    wc.hInstance = hInst;
    wc.lpszClassName = L"myWindowClass";
    wc.lpfnWndProc = WindowProcedure;
if there is, can tell me what the window variable name is
It's a window class. You must register a window class before you can create a window. The background colour is set using the HBRUSH part, and then the cursor type after that (in your code). IDC_ARROW is the most common, probably the cusor type you're using right now. The hInstance part is (if I remember correctly) a handle to the application your making that your window will run in. Its variable type is of type HINSTANCE.

Windows Data Types (BaseTsd.h) - Win32 apps | Microsoft Learn

Scroll down until you find it. It's not all that helpful to be honest, just know that the HINSTANCE hInst in your code is very important and is something your window class will want. Then the class is given a name. In this case it's "myWindowClass".

Note the L before it means the string will be converted into a wide character string. The last part:

Code:
wc.lpfnWndProc = WindowProcedure;
Determines which message handling function you want to use to handle messages sent to the window. You have to make this yourself although most IDE's (the place where you write your code) I imagine make one for you as an example.