OK, I tried very hard to reduce the time it takes to get the DIB from the hdc.
The only way I could do it in a reasonable time (40ms) is by setting the "Hardware Acceleration" to none.
But now the video games don't work.
You suggested that there may be another way using DrawDIB functions but I could not see how I can get the DIB from the hdc, or using Direct-Show, but again I don't understand how to do it.
It is extremely important for me to solve this problem because the whole project depends on it.