fix system file picker ins preview
This commit is contained in:
parent
9d410dfe9c
commit
0e5d11f9cd
19
extern/nfd-modified/src/nfd_win.cpp
vendored
19
extern/nfd-modified/src/nfd_win.cpp
vendored
|
@ -532,6 +532,9 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
||||||
nfdselcallback_t selCallback )
|
nfdselcallback_t selCallback )
|
||||||
{
|
{
|
||||||
nfdresult_t nfdResult = NFD_ERROR;
|
nfdresult_t nfdResult = NFD_ERROR;
|
||||||
|
NFDWinEvents* winEvents;
|
||||||
|
bool hasEvents=true;
|
||||||
|
DWORD eventID=0;
|
||||||
|
|
||||||
|
|
||||||
HRESULT coResult = COMInit();
|
HRESULT coResult = COMInit();
|
||||||
|
@ -566,6 +569,16 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
||||||
goto end;
|
goto end;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Pass the callback
|
||||||
|
winEvents=new NFDWinEvents(selCallback);
|
||||||
|
if ( !SUCCEEDED(fileOpenDialog->Advise(winEvents,&eventID)) ) {
|
||||||
|
// error... ignore
|
||||||
|
hasEvents=false;
|
||||||
|
winEvents->Release();
|
||||||
|
} else {
|
||||||
|
winEvents->Release();
|
||||||
|
}
|
||||||
|
|
||||||
// Set a flag for multiple options
|
// Set a flag for multiple options
|
||||||
DWORD dwFlags;
|
DWORD dwFlags;
|
||||||
result = fileOpenDialog->GetOptions(&dwFlags);
|
result = fileOpenDialog->GetOptions(&dwFlags);
|
||||||
|
@ -613,8 +626,12 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
if ( fileOpenDialog )
|
if (fileOpenDialog) {
|
||||||
|
if (hasEvents) {
|
||||||
|
fileOpenDialog->Unadvise(eventID);
|
||||||
|
}
|
||||||
fileOpenDialog->Release();
|
fileOpenDialog->Release();
|
||||||
|
}
|
||||||
|
|
||||||
COMUninit(coResult);
|
COMUninit(coResult);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue