Make this function reusable in order to allow it to be called from the native MSW wxProgressDialog implementation in the upcoming commit.