showDialog method

int showDialog(
  1. String title,
  2. String text, {
  3. int flags = 0,
  4. bool modal = false,
})

Shows a dialog.

Implementation

int showDialog(String title, String text,
    {int flags = 0, bool modal = false}) {
  final hwnd = this.hwnd;

  final titlePointer = title.toNativeUtf16();
  final textPointer = text.toNativeUtf16();

  if (modal) {
    flags |= MESSAGEBOX_STYLE.MB_SYSTEMMODAL;
  }

  final result = MessageBox(
    hwnd,
    textPointer,
    titlePointer,
    flags,
  );

  free(titlePointer);
  free(textPointer);

  return result;
}