ApplicationSystem also needs HasMainDocument check run message loop or not. 
Or shall we move this function in class ApplicationData?