Added Win Messages and Logic