Ver Mensaje Individual
  #1 (permalink)  
Antiguo 27/07/2010, 08:54
Avatar de RIVERMILLOS
RIVERMILLOS
 
Fecha de Ingreso: marzo-2010
Mensajes: 1.336
Antigüedad: 14 años, 2 meses
Puntos: 15
saber que ventana esta abierta o activa c++

hola tengo esta funcion que guarda en un log que ventana esta abierta pero el problema es que me guarda todas las ventanas que tengo mas no solo que tengo activa como puedo arreglar esto..

Código:
BOOL CALLBACK enumproc(HWND hwnd,LPARAM lParam)
{
    char stTitle[MAX_PATH];
    ofstream log1("C:\\log.txt", ios::app);
    if(GetForegroundWindow() && IsWindowVisible(hwnd)){
        GetWindowText(hwnd,stTitle,MAX_PATH);
        log1<< stTitle<<endl;
    }
    return TRUE;
}
saludos