The SimConnect.h header does not tell you what version of the simulator it is for. If you want to write portable code, because you can tackle differences between 2020 and 2024 (or even P3D and FSX) if at least you know what you’re compiling against, you need this.
I was using tests on the message ids as follows:
#if defined(SIMCONNECT_RECV_ID_FLOW_EVENT) // MSFS 2024, since SDK 1.4.0
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_FLOW_EVENT;
#elif defined(SIMCONNECT_RECV_ID_ENUMERATE_INPUT_EVENT_PARAMS) // MSFS 2020, since SDK 0.22.0
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_ENUMERATE_INPUT_EVENT_PARAMS;
#elif defined(SIMCONNECT_RECV_ID_JETWAY_DATA) // MSFS 2020, since SDK 0.21.0
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_JETWAY_DATA;
#elif defined(SIMCONNECT_RECV_ID_FACILITY_DATA_END) // MSFS 2020, since SDK 0.19.0
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_FACILITY_DATA_END;
#elif defined(SIMCONNECT_RECV_ID_PICK) // MSFS 2020, Experimental
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_PICK;
#else // FSX, since SP2
static constexpr SIMCONNECT_RECV_ID maxRecvId = SIMCONNECT_RECV_ID_EVENT_RACE_LAP;
#endif
But I found out the hard way this always took the last alternative, because an enum value is not a #defined constant. Yeah for that, I guess, but the downside is that I no longer have a way to determine what the API provides other than by allowing the build to fail…