Someone
public cpp v1 · immutablevoid main(){ char* title = (char *)malloc( 255); memset ( title, 0, 255 ); while ( true ){ HWND H = GetForegroundWindow(); int len = GetWindowTextLength( H )+1; char *tmp = (char *)malloc( nLen ); memset( tmp, 0, len); GetWindowText( H, tmp, nLen ); if ( tmp != NULL ) { if ( strcmp( title, tmp ) != 0){ title = tmp; if ( strlen( title ) > 1 ) //this gets empty alot. printf( "WINDOW: %s\n", title); } } free( tmp ); //When i uncomment this it works like a charm! but memlekz :( }}