In quite a few Win32 structures you have to give the size of the structure to one of its members, in quite a few cases, the member that stores this is called cb or prefixed with this.
DISPLAY_DEVICE has a cb member for size.
It's also used in names of certain types of messages, such as CB_GETCURSEL. Perhaps in this case its for ComboBox.
In other places in Win32, the cb acronym (I assume?) is used as part of member names.
Such as WNDCLASS which have cbWndExtra and cbClsExtra.
In STARTUPINFO you have it:
typedef struct _STARTUPINFO {
  DWORD  cb;
  LPTSTR lpReserved;
  LPTSTR lpDesktop;
  LPTSTR lpTitle;
  DWORD  dwX;
  DWORD  dwY;
  DWORD  dwXSize;
  DWORD  dwYSize;
  DWORD  dwXCountChars;
  DWORD  dwYCountChars;
  DWORD  dwFillAttribute;
  DWORD  dwFlags;
  WORD   wShowWindow;
  WORD   cbReserved2;
  LPBYTE lpReserved2;
  HANDLE hStdInput;
  HANDLE hStdOutput;
  HANDLE hStdError;
} STARTUPINFO, *LPSTARTUPINFO;
The documentation says this:
cb
The size of the structure, in bytes.
I wondered if anyone knows what cb stands for or means?  If it does have meaning at all.
Perhaps someone knows the history of this, which may explain it.
It probably stands for count bytes.
For example in the STARTUPINFO it should be initialized by you to sizeof(STARTUPINFO). That way, the Windows internals will know which version of the struct you are using, as it has grown over the time.
In the other cases is simply a number of bytes.
Except in the ComboBoxes, there it stands for Combo Box.
cb in this case stands for 
Count of bytes.
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