All pastes #958517 Raw Edit

Someone

public cpp v1 · immutable
#958517 ·published 2008-03-26 19:56 UTC
rendered paste body
void 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 :(	}}