The issue here is that TCITEM is not enough to hold lparam over sizeof(LPARAM).
This message is misleading. Shouldn't it be TCITEM is not enough to hold the extra item size sizeof(LPARAM)+1? For the "SendMessageA(hTab, TCM_SETITEMEXTRA, sizeof(LPARAM)+1, 0)" call?