#include<graphics.h>
#include<conio.h>
void messagewindow(int = 80, int = 160, int = 240, int = 480,
                                  char *message = "Hello!");
void main(void) {
    int gdriver = DETECT, gmode, errorcode;
    initgraph(&gdriver,&gmode,"");
    messagewindow();         // opens messagewindow at the default locations getch();
    messagewindow(150,200);         // opens messagewindow at 150,200 and 240,480
    getch();
    // opens a message window at the specified location
    messagewindow(180,320,300,560,"GoodBye!");
    getch();
    closegraph();
}
void messagewindow(int trow, int lcol, int brow, int rcol, char *message) {
    // reset viewport to full screen
    setviewport(0,0,getmaxx(),getmaxy(),1);
    // draw rectangle
    rectangle(lcol,trow,rcol,brow);
    // set viewport to just inside rectangle
    setviewport(lcol+1,trow+1,rcol-1,brow-1,1);
    // clear it
    clearviewport();
    // print message
   outtextxy(0,0,message);
}
