add message handling in windows backend, fixed some errors