getCurrentSelection method
Gets the user's current selection in the dialog.
Throws a WindowsException on failure.
To learn more, see learn.microsoft.com/windows/win32/api/shobjidl_core/nf-shobjidl_core-ifiledialog-getcurrentselection.
Implementation
IShellItem? getCurrentSelection() {
final ppsi = adaptiveCalloc<VTablePointer>();
final hr$ = HRESULT(_GetCurrentSelectionFn(ptr, ppsi));
if (hr$.isError) {
free(ppsi);
throw WindowsException(hr$);
}
final result$ = ppsi.value;
free(ppsi);
if (result$.isNull) return null;
return .new(result$);
}