Exemple #1
0
void
awl::backends::windows::message_box(
	awl::backends::windows::window::const_optional_object_ref const &_opt_window,
	fcppt::string const &_text,
	fcppt::string const &_title,
	UINT const _type
)
{
	if(
		::MessageBox(
			fcppt::optional::maybe(
				_opt_window,
				fcppt::const_<
					HWND
				>(
					nullptr
				),
				[](
					fcppt::reference<
						awl::backends::windows::window::object const
					> const _window
				)
				{
					return
						_window.get().hwnd();
				}
			),
			_text.c_str(),
			_title.c_str(),
			_type
		)
		== 0
	)
		throw
			awl::exception(
				FCPPT_TEXT("MessageBox failed: ")
				+
				_text
			);
}
Exemple #2
0
void
fruitlib::message_box(
	fcppt::string const &s)
{
#ifdef FCPPT_CONFIG_WINDOWS_PLATFORM
	if(
		::MessageBox(
			NULL,
			s.c_str(),
			FCPPT_TEXT("Error"),
			MB_OK | MB_ICONERROR) == 0)
		fcppt::io::cerr() << FCPPT_TEXT("MessageBox failed!\n");
#else
	fcppt::io::cerr() << FCPPT_TEXT("Error: ") << s << FCPPT_TEXT("\n");
#endif
}