Questions:
- Why is the 32770 magic number used?
- What does the if statement check?
As already said by JJ #32770 is the name of the dialog windows class. Because you want create such kind of window you'll use the function GetClassInfoEx to get all class informations to use for our new window.
To be sure that we get correct class data we have to check which value is returned from the function. GetClassInfoEx returns 0 if it fails (class data is not valid) or a value>0 if success.
The form:
if (something)
in C is TRUE if something <>0. The estended form should be:
if (something != 0)
Which is equivalent to the former.
The operator ! negates the logical value: TRUE became FALSE and the reverse. So:
if (!GetClassInfoEx(NULL, MAKEINTRESOURCE(32770), &wcx))
return 0;
Works this way:
- Executes the function
- Invert the result of function (fail becomes TRUE)
- if function fails exit program with vallue 0 (return 0;)