Is there a simple way?
SystemParametersInfo(SPI_GETKEYBOARDSPEED, 0, &dwSpeed, 0);
Why don't you call SystemParametersInfo with corresponding flag (SPI_GETKEYBOARDSPEED) instead?