According to MSDN, the lpClassName
parameter of CreateWindowEx
is optional.
lpClassName [in, optional]
However, the documentation makes no mention of what it means to pass NULL
. What's more, if NULL
is passed, then there is no way for the window manager to find a window procedure for the new window.
So, is the documentation wrong? Or is it correct and there is some scenario where NULL
is a valid value for lpClassName
?
The lpClassName
parameter to CreateWindowEx
is declared to be an LPCTSTR
but it can actually be either a pointer to a string or a class atom returned by RegisterClass
or RegisterClassEx
.
Ideally the type annotation would specify precisely what's allowed for this parameter, but I guess the annotation language doesn't have a way of describing the types of things that don't match their declared type.
The best they could do is declare it as optional to indicate that the string might not be valid.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With