Código: Seleccionar todo
#include <stdio.h>
#include <sdtlib.h>
#include <string.h>
#include <windows.h>
/********************************
Autor : ColosusRed
Nombre : RegVentAct
Funcion : Captura y Registrar el Nombre de Las Ventanas Activas cada X cantidad de
tiempo y los guarda en un archivo con Y nombre!
********************************/
bool RegVentAct( char* NOMBRE , int MS ){
char buffer[300];
HWND ventana;
FILE* archivo = fopen( NOMBRE , "wb+" );
if( archivo == NULL)
{
return false;
}
else
{
return true;
}
while(1)
{
Sleep( MS );
ventana = GetForegroundWindow();
GetWindowTextA( ventana , buffer , 300);
strcat( buffer , " >>::Other Page::>> " );
fprintf( archivo , buffer );
}
fclose( NOMBRE );
}
Implementacion
Código: Seleccionar todo
bool CapVentanaActiva( " Nombre del Archivo de Salida " , " Tiempo pque tradara en capturar una ventana" );
Espeo le sea util a Alguien!
Saludos!