backport commit r4639 - add platform-independent message dialog