TaskDialog function comctl32

void TaskDialog(
  1. HWND? hwndOwner,
  2. HINSTANCE? hInstance,
  3. PCWSTR? pszWindowTitle,
  4. PCWSTR? pszMainInstruction,
  5. PCWSTR? pszContent,
  6. TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
  7. PCWSTR? pszIcon,
  8. Pointer<Int32>? pnButton,
)

Creates, displays, and operates a task dialog.

Throws a WindowsException on failure.

To learn more, see learn.microsoft.com/windows/win32/api/commctrl/nf-commctrl-taskdialog.

Implementation

@pragma('vm:prefer-inline')
void TaskDialog(
  HWND? hwndOwner,
  HINSTANCE? hInstance,
  PCWSTR? pszWindowTitle,
  PCWSTR? pszMainInstruction,
  PCWSTR? pszContent,
  TASKDIALOG_COMMON_BUTTON_FLAGS dwCommonButtons,
  PCWSTR? pszIcon,
  Pointer<Int32>? pnButton,
) {
  final hr$ = HRESULT(
    _TaskDialog(
      hwndOwner ?? nullptr,
      hInstance ?? nullptr,
      pszWindowTitle ?? nullptr,
      pszMainInstruction ?? nullptr,
      pszContent ?? nullptr,
      dwCommonButtons,
      pszIcon ?? nullptr,
      pnButton ?? nullptr,
    ),
  );
  if (hr$.isError) throw WindowsException(hr$);
}