#include "graphics.h" int getactivepage(void);
The active graphics page might not be the one you see onscreen, depending on how many graphics pages are available on your system.
The original winbgi was designed to support up to 16 pages, but I have only used pages 1 and 2 myself. NOTE: Using page number 0 might mess up the colors. I use pages 1-2 for double buffering.