The size of the structure is fixed at compile time, this makes it possible to identify for which Windows version a program was designed, at execution time.
Suppose you use the
OPENFILENAME[
^] structure and you define your Windows version so that it will run on Windows NT 4.0. This means some members are not included in the structure when you compile it, and the sizeof() function will return a smaller result.
Now if you were to execute your program on Windows 2000 (NT 5.0), the lStructSize variable will make clear that the extra variables are not to be used because your program did not allocate memory for them.
So the conclusion is, this allows for expansion of the struct while maintaining backward compatibility.