Nuevas NORMAS para el foro

Curso Hacker
Bienvenido(a), Visitante. Favor de ingresar o registrarse.
¿Perdiste tu email de activación? - ſeptiembre 05, 2008, 04:37:27
Boton Buscar
Inicio Ayuda Ingresar Registrarse
Visita: Articulos - Juegos Gratis - Da Foros

Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: PROTECTOR DE PANTALLA EN C++ 0 Usuarios y 1 Visitante están viendo este tema. « anterior próximo »
Páginas: [1] Ir Abajo Imprimir
Autor Tema: PROTECTOR DE PANTALLA EN C++  (Leído 560 veces)
J@Ker Lo10
Habitual
*****
Desconectado Desconectado

Mensajes: 200


'LA PRimeR @ VivE' J @Ker LOlo

???? ???? ????
Ver Perfil
« en: Marzo 26, 2005, 05:19:34 »

HOLA HE AKI EL PROTECTOR DE PANTALLA
MM SOLO FALTA QUE AL MOVERLE EL MOUSE SE SALGA
ES KE ESTA MUY LARGO EL .H Y SE LOS PONDO SIN MOUSE
OK CHEKENLO...
SOLO GUERDENLO COMO .SRC Y LISTO SU PRIMER PROTECTOR DE PANTALLA EN C++

//*****************************************
#include <iostream.h>
#include <conio.h>
#include <stdio.h>
#include <dos.h>
#include <time.h>
#include <conio.h>
#include<stdlib.h>
#include <graphics.h>

float horas,minutos,segundos;
float hora_final,minuto_final,segundo_final;

void ModoGrafico(void);
void diagonal(void);
void diagonal2(void);
void filas(void);
void columnas(void);
void circulo(void);
void VerTiempo(void);
void VerTiempoTrascurrido(void);
//PROGRAMA PRINCIPAL
void main(void)
{
 VerTiempo();
 ModoGrafico();
   for(int i=1;i<=2;i++)
   {   setcolor(random(14));

         columnas();
         cleardevice();


         diagonal();
         cleardevice();

         filas();
         cleardevice();

         diagonal2();
         cleardevice();

         circulo();
         cleardevice();
         i=1;
         if(kbhit())
         {
         i=3;
         closegraph();
         }
   }


   clrscr();
   VerTiempoTrascurrido();

 getch();
}





















//********************************FUNCIONES**********************************
//FUNCION QUE ENTRA A MODO GRAFICO
void ModoGrafico(void)
{
   //SOLICITAR MODO GRAFICO
   int gdriver = DETECT, gmode, errorcode;
   initgraph(&gdriver, &gmode, "\\tc\\bgi");
   errorcode = graphresult();
   if (errorcode != grOk)  /* ERROR OCURRIDO */
   {
      printf("Error al entrar a Modo Grafico: %s\n", grapherrormsg(errorcode));
      printf("Presione una tecla para salir:");
      getch();
      exit(1);
   }

}

//FUNCION QUE DIBUJA UN CIRCULO
void circulo(void)
{
 for(int i=1;i<=80;i++)
     {
      int x,y;
      x=random(600);y=random(500);
      circle(x,y,20);
      delay(200);
     // i=1;
      if(kbhit())
   {
    i=81;
   }

     }
}

//FUNCION QUE DIBUJA DIAGONALES DESDE LA PARTE
//SUPERIOR IZQUIERDA HACIA LA PARTE INFERIOR DERECHA
void diagonal(void)
{
 int a=10,b=1,a1=1,b1=10;
 for(int i=1;i<=56;i++)
    {
     setcolor(random(14));
     line(a,b,a1,b1);
     a=a+20;
     b1=b1+20;
     delay (250);
    // i=1;
     if(kbhit())
   {
    i=57;
   }
    }

}
//FUNCION QUE DIBUJA DIAGONALES DESDE LA PARTE
//INFERIRO IZQUIERDA HACIA LA PARTE SUPERIOR DERECHA
void diagonal2(void)
{
 int aa=1,bb=470,aa1=30,bb1=500;
 for (int i=1;i<=56;i++)
       {
       setcolor(random(14));
       line(aa,bb,aa1,bb1);
       aa1=aa1+20;
       bb=bb-20;
       delay(250);
      // i=1;
       if(kbhit())
   {
    i=57;
   }
     }
 }

//FUNCION QUE DIBUJA FILAS DESDE LA PARTE
//SUPERIO  HACIA LA PARTE INFERIOR
void filas(void)
{
 int p=1,e=10,p1=620,e1=10;
 for(int i=1;i<=25;i++)
    { setcolor(random(14));
    line(p,e,p1,e1);
    e=e+20;
    e1=e1+20;
    delay (250);
    //i=1;
    if(kbhit())
   {
    i=26;
   }
    }
}

//FUNCION QUE DIBUJA FILAS DESDE LA PARTE
//SUPERIO  HACIA LA PARTE INFERIOR
void columnas(void)
{
  int pp=10,ee=1,pp1=10,ee1=480; ///verticales
  for(int i=1;i<=35;i++)
     { setcolor(random(14));
      line(pp,ee,pp1,ee1);
      pp=pp+20;
      pp1=pp1+20;
      delay (250);
      //i=1;
    if(kbhit())
   {
    i=36;
   }
    }
}

//FUNCION PARA VER LA HORA
void VerTiempo(void)
{
   for(int i=1;i<=5;i++)
   {
    struct  time tiempo;
    gettime(&tiempo);

    horas= tiempo.ti_hour;
    minutos=tiempo.ti_min;
    segundos=tiempo.ti_sec;
    delay(1200);
   gotoxy(30,15);
   cout<<"Hora local: "<<horas<<":"<<minutos<<":"<<segundos;

   }

}

//FUNCION PARA VER EL TIEMPO TRANSCURRIDO
void VerTiempoTrascurrido(void)
{
   float hor,min,seg;
   struct  time tiempo;
   gettime(&tiempo);
   hora_final= tiempo.ti_hour;
   minuto_final=tiempo.ti_min;
   segundo_final=tiempo.ti_sec;

   hor=hora_final-horas;
   min=minuto_final-(minutos+1);
   seg=(60-segundos) +segundo_final;

   gotoxy(30,15);cout<<"Hora Inicio: "<<horas<<":"<<minutos<<":"<<segundos;
   gotoxy(30,16);cout<<"Hora local: "<<hora_final<<":"<<minuto_final<<":"<<segundo_final;

  gotoxy(30,18);cout<<"Tiempo transcurrido: ";
  gotoxy(30,20); cout<<hor<<" horas";
  gotoxy(30,21); cout<<min<<" Minutos";
  gotoxy(30,22); cout<<seg<<" Segundos";

}

En línea

El ConoCIMIenTo no lleGA poR si solo,
soLO kE el MEdio pARA oBteNERlo es ..........
Páginas: [1] Ir Arriba Imprimir 
Comunidad Underground Hispana  |  Programacion  |  Programación  |  Carbide C/C#/C++  |  Tema: PROTECTOR DE PANTALLA EN C++ « anterior próximo »
Ir a:  


Ranking-Hits
Powered by SMF 1.1.5 | SMF © 2006-2007, Simple Machines LLC