mirror of
https://github.com/tildearrow/furnace.git
synced 2024-11-22 20:45:11 +00:00
fix system file picker ins preview
This commit is contained in:
parent
9d410dfe9c
commit
0e5d11f9cd
1 changed files with 18 additions and 1 deletions
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 )
|
||||
{
|
||||
nfdresult_t nfdResult = NFD_ERROR;
|
||||
NFDWinEvents* winEvents;
|
||||
bool hasEvents=true;
|
||||
DWORD eventID=0;
|
||||
|
||||
|
||||
HRESULT coResult = COMInit();
|
||||
|
@ -566,6 +569,16 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
|||
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
|
||||
DWORD dwFlags;
|
||||
result = fileOpenDialog->GetOptions(&dwFlags);
|
||||
|
@ -613,8 +626,12 @@ nfdresult_t NFD_OpenDialogMultiple( const std::vector<std::string>& filterList,
|
|||
}
|
||||
|
||||
end:
|
||||
if ( fileOpenDialog )
|
||||
if (fileOpenDialog) {
|
||||
if (hasEvents) {
|
||||
fileOpenDialog->Unadvise(eventID);
|
||||
}
|
||||
fileOpenDialog->Release();
|
||||
}
|
||||
|
||||
COMUninit(coResult);
|
||||
|
||||
|
|
Loading…
Reference in a new issue