onOverwrite method
Called from the save dialog when the user chooses to overwrite a file.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialogevents-onoverwrite.
Implementation
FDE_OVERWRITE_RESPONSE onOverwrite(IFileDialog? pfd, IShellItem? psi) {
final pResponse = adaptiveCalloc<Int32>();
final hr$ = HRESULT(
_OnOverwriteFn(ptr, pfd?.ptr ?? nullptr, psi?.ptr ?? nullptr, pResponse),
);
if (hr$.isError) {
free(pResponse);
throw WindowsException(hr$);
}
final result$ = pResponse.value;
free(pResponse);
return .new(result$);
}