This is done with the bit masks
. Look at the values of
, etc.: http://msdn.microsoft.com/en-us/library/windows/desktop/ms632600%28v=vs.85%29.aspx
As you can see, each of them is the order of 2. That is, each of them takes exactly one bit in the word. And you can always check a bit in one statement. Consider:
BOOL isVisible = (myWindowStyle & WS_VISIBLE) > 0;
BOOL isChild = (myWindowStyle & WS_CHILD) > 0;
Bit-masking techniques could be much more complex than that, yet simple enough and very effective.
See also: http://www.cprogramming.com/tutorial/bitwise_operators.html