handling of mouse messages more conform docs, some cleanup