getcurrentwindow


Syntax
#include "graphics.h"
int getcurrentwindow( );
Description[WIN]
The getcurrentwindow function is available in the winbgim implementation of BGI graphics. You do not need to include conio.h; just include graphics.h.

The function gets the current window number, which is the window where all graphics operations occur.

See also
setcurrentwindow
initgraph
initwindow

Example
/* setcurrentwindow example */ 
#include 

void change ( int window )
{
    int oldwindow = getcurrentwindow( );
    setcurrentwindow(window);
   
    // Do whatever graphics operations you like in the new current
    // window...

    // Restore the original window:
    setcurrentwindow(oldwindow);
}

Back to index