add loging window & send msg to the main thread.