36 lines
895 B
C++
36 lines
895 B
C++
#include<stdio.h>
|
|
#include<conio.h>
|
|
|
|
char ventana (int ancho,int largo,int color_g,int color_borde,char titulo,
|
|
int color_titulo,int posx,int posy);
|
|
|
|
void main() {
|
|
clrscr();
|
|
ventana(40,10,7,1,'P',14,30,7);
|
|
fflush(stdin);
|
|
getch();
|
|
}
|
|
|
|
// Funci¢n ventana.
|
|
char ventana (int ancho,int largo,int color_g,int color_borde,char titulo,
|
|
int color_titulo,int posx,int posy) {
|
|
int x,y,cony,conx;
|
|
char dib;
|
|
dib='Û';
|
|
for (cony=0,y=posy;cony<largo;cony++,y++){
|
|
for (conx=0,x=posx;conx<ancho;conx++,x++) {
|
|
gotoxy(x,y);
|
|
if (x==posx || y==posy || y==(posy+(largo-1)) || x==(posx+1)
|
|
|| x==(posx+(ancho-2)) || x==(posx+(ancho-1)))
|
|
textcolor(color_borde);
|
|
else
|
|
textcolor(color_g);
|
|
cprintf ("%c",dib);
|
|
}
|
|
}
|
|
gotoxy((posx+2),posy);
|
|
textcolor(color_titulo);
|
|
textbackground(color_borde);
|
|
cprintf("%c",titulo);
|
|
return(0);
|
|
} |