add application register/unregister at startup window function