diff --git a/src/Bindings/Platform.cpp b/src/Bindings/Platform.cpp index f4ad97f..205651d 100644 --- a/src/Bindings/Platform.cpp +++ b/src/Bindings/Platform.cpp @@ -132,6 +132,20 @@ namespace Dotx64Dbg::Native { SetClipboardData(CF_UNICODETEXT, hMem); CloseClipboard(); } + + static void MessageBoxInfo(System::String^ text, System::String^ title) + { + const auto textStr = interop::toUTF16(text); + const auto titleStr = title ? interop::toUTF16(title) : L"Information"; + MessageBoxW(GuiGetWindowHandle(), textStr.c_str(), titleStr.c_str(), MB_ICONINFORMATION); + } + + static void MessageBoxError(System::String^ text, System::String^ title) + { + const auto textStr = interop::toUTF16(text); + const auto titleStr = title ? interop::toUTF16(title) : L"Error"; + MessageBoxW(GuiGetWindowHandle(), textStr.c_str(), titleStr.c_str(), MB_ICONERROR); + } }; } diff --git a/src/Dotx64Managed/API/Platform.cs b/src/Dotx64Managed/API/Platform.cs index f0ec237..651dc10 100644 --- a/src/Dotx64Managed/API/Platform.cs +++ b/src/Dotx64Managed/API/Platform.cs @@ -22,5 +22,15 @@ public static void SetClipboardText(string text) { Native.Platform.SetClipboardText(text); } + + public static void MessageBoxInfo(string text, string title = null) + { + Native.Platform.MessageBoxInfo(text, title); + } + + public static void MessageBoxError(string text, string title = null) + { + Native.Platform.MessageBoxError(text, title); + } } }